Ruby on Rails Wednesday, December 15, 2010

Hi,
I'm developing with ruby-1.9. 1 rails 3.0.0.
I want to relate 'User' model and 'Payment' model with condition which
has the same value as 'user.testing' in 'payment.testing'

I did

Class User < ActiveRecord::Base
has_many payments, :conditions => ['testing = ?', self.testing]
end

This doesn't work.
I tried also below, but doesn't work too.
has_many payments, :conditions => ['testing = ?',
#{self.send(:testing)}]

Any ideas?

Regards.

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment