class method
self.new
Ruby on Rails 4.2.9
Since v4.0.13 Last seen in v8.0.4Signature
self.new(model, name)
No documentation comment.
Parameters
-
modelreq -
namereq
Source
# File activerecord/lib/active_record/dynamic_matchers.rb, line 56
def initialize(model, name)
@model = model
@name = name.to_s
@attribute_names = @name.match(self.class.pattern)[1].split('_and_')
@attribute_names.map! { |n| @model.attribute_aliases[n] || n }
end
Defined in activerecord/lib/active_record/dynamic_matchers.rb line 56
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::DynamicMatchers::Method