Module: Sequel::Plugins::InstanceFilters::InstanceMethods
- Defined in:
- lib/sequel/plugins/instance_filters.rb
Instance Method Summary collapse
-
#after_destroy ⇒ Object
Clear the instance filters after successfully destroying the object.
-
#after_update ⇒ Object
Clear the instance filters after successfully updating the object.
-
#freeze ⇒ Object
Freeze the instance filters when freezing the object.
-
#instance_filter(*args, &block) ⇒ Object
Add an instance filter to the array of instance filters Both the arguments given and the block are passed to the dataset’s filter method.
Instance Method Details
#after_destroy ⇒ Object
Clear the instance filters after successfully destroying the object.
55 56 57 58 |
# File 'lib/sequel/plugins/instance_filters.rb', line 55 def after_destroy super clear_instance_filters end |
#after_update ⇒ Object
Clear the instance filters after successfully updating the object.
61 62 63 64 |
# File 'lib/sequel/plugins/instance_filters.rb', line 61 def after_update super clear_instance_filters end |
#freeze ⇒ Object
Freeze the instance filters when freezing the object
67 68 69 70 |
# File 'lib/sequel/plugins/instance_filters.rb', line 67 def freeze instance_filters.freeze super end |
#instance_filter(*args, &block) ⇒ Object
Add an instance filter to the array of instance filters Both the arguments given and the block are passed to the dataset’s filter method.
75 76 77 |
# File 'lib/sequel/plugins/instance_filters.rb', line 75 def instance_filter(*args, &block) instance_filters << [args, block] end |