Class Index [+]

Quicksearch

Sequel::Plugins::InstanceFilters::InstanceMethods

Public Instance Methods

after_destroy() click to toggle source

Clear the instance filters after successfully destroying the object.

    # File lib/sequel/plugins/instance_filters.rb, line 51
51:         def after_destroy
52:           super
53:           clear_instance_filters
54:         end
after_update() click to toggle source

Clear the instance filters after successfully updating the object.

    # File lib/sequel/plugins/instance_filters.rb, line 57
57:         def after_update
58:           super
59:           clear_instance_filters
60:         end
instance_filter(*args, &block) click to toggle source

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.

    # File lib/sequel/plugins/instance_filters.rb, line 65
65:         def instance_filter(*args, &block)
66:           instance_filters << [args, block]
67:         end

Private Instance Methods

_delete_dataset() click to toggle source

Apply the instance filters to the dataset returned by super.

    # File lib/sequel/plugins/instance_filters.rb, line 97
97:         def _delete_dataset
98:           apply_instance_filters(super)
99:         end
_delete_without_checking() click to toggle source

If there are any instance filters, make sure not to use the instance delete optimization.

    # File lib/sequel/plugins/instance_filters.rb, line 73
73:         def _delete_without_checking
74:           if @instance_filters && !@instance_filters.empty?
75:             _delete_dataset.delete 
76:           else
77:             super
78:           end
79:         end
_update_dataset() click to toggle source

Apply the instance filters to the dataset returned by super.

     # File lib/sequel/plugins/instance_filters.rb, line 102
102:         def _update_dataset
103:           apply_instance_filters(super)
104:         end
apply_instance_filters(ds) click to toggle source

Apply the instance filters to the given dataset

    # File lib/sequel/plugins/instance_filters.rb, line 87
87:         def apply_instance_filters(ds)
88:           instance_filters.inject(ds){|ds, i| ds.filter(*i[0], &i[1])}
89:         end
clear_instance_filters() click to toggle source

Clear the instance filters.

    # File lib/sequel/plugins/instance_filters.rb, line 92
92:         def clear_instance_filters
93:           instance_filters.clear
94:         end
instance_filters() click to toggle source

Lazily initialize the instance filter array.

    # File lib/sequel/plugins/instance_filters.rb, line 82
82:         def instance_filters
83:           @instance_filters ||= []
84:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.