Ruby on Rails Wednesday, December 15, 2010

On 15 December 2010 17:01, Tim Shaffer <timshaffer@me.com> wrote:
> You could just use a method instead...
>
> class User < ActiveRecord::Base
>
>   has_many :payments
>
>   def testing_payments
>     payments.where(:testing => testing)
>   end

That would be even better as a named scope.

Colin

--
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