David,

thank you so much, that was the correct answer.


My complete association extension is now:

class Dropzone < ActiveRecord::Base
  has_many :transactions, :through => :accounts do
    def limited_to(transaction)
      scope = Transaction.scoped({ :conditions =>
['accounts.dropzone_id = ?', proxy_owner.id],
                                   :include    =>
[:account, :payment_method, :slot] })
      scope = scope.scoped :conditions => ['name ILIKE ?', "%#
{transaction.account_name}%"] unless transaction.account_name.blank?
      scope = scope.scoped :conditions => ['payment_method_id = ?',
transaction.payment_method_id] unless
transaction.payment_method_id.blank?
      scope
    end
  end
end


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to