Method: Searchlogic::ActiveRecord::Scope#scopes
- Defined in:
- lib/searchlogic/active_record/scope.rb
#scopes ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/searchlogic/active_record/scope.rb', line 9 def scopes read_inheritable_attribute(:scopes) || write_inheritable_attribute(:scopes, {}.tap do |h| class << h attr_accessor :active_record_class end h.active_record_class = self h.instance_eval <<-eval def include?(key) result = super return result if result active_record_class.respond_to?(key) super end eval end) end |