Class ActiveRecord::DynamicScopeMatch
In: vendor/rails/activerecord/lib/active_record/dynamic_scope_match.rb
Parent: Object

Methods

match   new   scope?  

Attributes

attribute_names  [R] 
scope  [R] 

Public Class methods

[Source]

   # File vendor/rails/activerecord/lib/active_record/dynamic_scope_match.rb, line 3
3:     def self.match(method)
4:       ds_match = self.new(method)
5:       ds_match.scope ? ds_match : nil
6:     end

[Source]

    # File vendor/rails/activerecord/lib/active_record/dynamic_scope_match.rb, line 8
 8:     def initialize(method)
 9:       @scope = true
10:       case method.to_s
11:       when /^scoped_by_([_a-zA-Z]\w*)$/
12:         names = $1
13:       else
14:         @scope = nil
15:       end
16:       @attribute_names = names && names.split('_and_')
17:     end

Public Instance methods

[Source]

    # File vendor/rails/activerecord/lib/active_record/dynamic_scope_match.rb, line 21
21:     def scope?
22:       !@scope.nil?
23:     end

[Validate]