Module: ActiveRecord::DynamicMatchers::Finder
- Included in:
- FindBy, FindByBang
- Defined in:
- activerecord/lib/active_record/dynamic_matchers.rb
Instance Method Summary collapse
- #attributes_hash ⇒ Object
-
#body ⇒ Object
Extended in activerecord-deprecated_finders.
- #finder ⇒ Object
-
#result ⇒ Object
Extended in activerecord-deprecated_finders.
-
#signature ⇒ Object
Extended in activerecord-deprecated_finders.
Instance Method Details
#attributes_hash ⇒ Object
92 93 94 |
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 92 def attributes_hash "{" + attribute_names.map { |name| ":#{name} => #{name}" }.join(',') + "}" end |
#body ⇒ Object
Extended in activerecord-deprecated_finders
78 79 80 |
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 78 def body result end |
#finder ⇒ Object
96 97 98 |
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 96 def finder raise NotImplementedError end |
#result ⇒ Object
Extended in activerecord-deprecated_finders
83 84 85 |
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 83 def result "#{finder}(#{attributes_hash})" end |
#signature ⇒ Object
Extended in activerecord-deprecated_finders
88 89 90 |
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 88 def signature attribute_names.join(', ') end |