Parent

Methods

Files

Class Index [+]

Quicksearch

ActiveRecord::DynamicScopeMatch

Active Record Dynamic Scope Match

Provides dynamic attribute-based scopes such as scoped_by_price(4.99) if, for example, the Product has an attribute with that name. You can chain more scoped_by_* methods after the other. It acts like a named scope except that it’s dynamic.

Attributes

scope[R]
attribute_names[R]

Public Class Methods

match(method) click to toggle source
    # File lib/active_record/dynamic_scope_match.rb, line 10
10:     def self.match(method)
11:       return unless method.to_s =~ /^scoped_by_([_a-zA-Z]\w*)$/
12:       new(true, $1 && $1.split('_and_'))
13:     end
new(scope, attribute_names) click to toggle source
    # File lib/active_record/dynamic_scope_match.rb, line 15
15:     def initialize(scope, attribute_names)
16:       @scope           = scope
17:       @attribute_names = attribute_names
18:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.