lib/faceted/collector.rb in faceted-1.0.0 vs lib/faceted/collector.rb in faceted-1.0.1
- old
+ new
@@ -17,10 +17,10 @@
module ClassMethods
def collects(name, args={})
@fields = [name]
- find_by = args[:find_by] ? args[:find_by] : "#{name.to_s.downcase.singularize}_id"
+ find_by = args[:find_by] ? args[:find_by] : "#{self.class.name.underscore.singularize}_id"
@collects ||= {}
@collects[name.downcase] = eval "#{scope}#{args[:class_name] || name.to_s.classify}"
define_method :"#{name.downcase}" do
objects(name.downcase.to_sym)
end
\ No newline at end of file