pass parameter from controller to models condition
- by Alex
I'm trying to bind a param to a join via a named scope., but I'm getting an error.
What is the correct way to do that?
has_one :has_voted, :class_name => 'Vote', :conditions => ['ip = :userIp']
# named scopes
scope :with_vote, lambda {|ip| {
:include => [:has_voted],
# like this ??
:conditions => [:has_voted => {:conditions =>…