Module: Specifind::Finder
- Included in:
- FindBy, FindByBang
- Defined in:
- lib/specifind/method_builder.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
105 106 107 |
# File 'lib/specifind/method_builder.rb', line 105 def attributes_hash "{" + attribute_names.map { |name| ":#{name} => #{name}" }.join(',') + "}" end |
#body ⇒ Object
Extended in activerecord-deprecated_finders
87 88 89 |
# File 'lib/specifind/method_builder.rb', line 87 def body result end |
#finder ⇒ Object
109 110 111 |
# File 'lib/specifind/method_builder.rb', line 109 def finder raise NotImplementedError end |
#result ⇒ Object
Extended in activerecord-deprecated_finders
92 93 94 95 96 97 98 |
# File 'lib/specifind/method_builder.rb', line 92 def result s = "#{model.name}" @attributes.each do |a| s += "#{a.to_where}" end s end |
#signature ⇒ Object
Extended in activerecord-deprecated_finders
101 102 103 |
# File 'lib/specifind/method_builder.rb', line 101 def signature attributes.map{|a| a.to_signature }.delete_if{|s| s == nil}.join(', ') end |