Module: Specifind::Finder

Included in:
FindBy, FindByBang
Defined in:
lib/specifind/method_builder.rb

Instance Method Summary collapse

Instance Method Details

#attributes_hashObject



105
106
107
# File 'lib/specifind/method_builder.rb', line 105

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

#bodyObject

Extended in activerecord-deprecated_finders



87
88
89
# File 'lib/specifind/method_builder.rb', line 87

def body
  result
end

#finderObject

Raises:

  • (NotImplementedError)


109
110
111
# File 'lib/specifind/method_builder.rb', line 109

def finder
  raise NotImplementedError
end

#resultObject

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

#signatureObject

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