Module: ActiveRecord::DynamicMatchers::Finder

Included in:
FindBy, FindByBang
Defined in:
activerecord/lib/active_record/dynamic_matchers.rb

Instance Method Summary collapse

Instance Method Details

#attributes_hashObject



92
93
94
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 92

def attributes_hash
  "{" + attribute_names.map { |name| ":#{name} => #{name}" }.join(',') + "}"
end

#bodyObject

Extended in activerecord-deprecated_finders



78
79
80
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 78

def body
  result
end

#finderObject

Raises:

  • (NotImplementedError)


96
97
98
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 96

def finder
  raise NotImplementedError
end

#resultObject

Extended in activerecord-deprecated_finders



83
84
85
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 83

def result
  "#{finder}(#{attributes_hash})"
end

#signatureObject

Extended in activerecord-deprecated_finders



88
89
90
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 88

def signature
  attribute_names.join(', ')
end