/usr/lib/ruby/vendor_ruby/sequel/plugins/scissors.rb is in ruby-sequel 4.15.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | module Sequel
module Plugins
# The scissors plugin adds class methods for update, delete, and destroy.
# It is so named because this is considered dangerous, since it is easy
# to write:
#
# Album.delete
#
# and delete all rows in the table, when you meant to write:
#
# album.delete
#
# and only delete a single row.
#
# This plugin is mostly useful for backwards compatibility, and not
# recommended for use in production. However, it can cut down on
# verbosity in non-transactional test code, so it may be appropriate
# to use when testing.
#
# Usage:
#
# # Make all model subclass run with scissors
# Sequel::Model.plugin :scissors
#
# # Make the Album class run with scissors
# Album.plugin :scissors
module Scissors
module ClassMethods
Plugins.def_dataset_methods(self, [:update, :delete, :destroy])
end
end
end
end
|