Permalink
Browse files

Switched to use the 'scoped' method to allow chaining scopes on relat…

…ionable associations.
  • Loading branch information...
1 parent 12b55ee commit 76641086ca7e28dafd34e43da4ddf569e833fea8 @kdonovan kdonovan committed Jun 29, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/acts_as_relationable.rb
@@ -38,7 +38,7 @@ def acts_as_relationable(*types)
fields.each do |field|
define_method field.to_s.pluralize do |*args|
value = args[0] || 1
- find :all, :conditions => [ "relationships.#{field} = ?", value ]
+ scoped :conditions => [ "relationships.#{field} = ?", value ]
end
end
end
@@ -49,7 +49,7 @@ def acts_as_relationable(*types)
fields.each do |field|
define_method field.to_s.pluralize do |*args|
value = args[0] || 1
- find :all, :conditions => [ "relationships.#{field} = ?", value ]
+ scoped :conditions => [ "relationships.#{field} = ?", value ]
end
end
end

0 comments on commit 7664108

Please sign in to comment.