Thanks Sebastian, after tweaking a little of my service class code, doing
f.association :active_tasks, collection: Task.all solved my problem
perfectly! Many thanks
On Friday, 24 August 2012 22:24:15 UTC+10, Sebastian Korfmann wrote:
>
> So, you want to select active tasks for the user, right?
>
> How about this (pseudo code, not actually tested)?
>
> class User
> has_many :task_assignments
> has_many :tasks, through: :task_assignments
> has_many :active_tasks, through: :task_assignments, conditions:
> {task_assignments: {disabled: false}}, source: :tasks
> end
>
--
You received this message because you are subscribed to the Google Groups "Ruby
or Rails Oceania" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rails-oceania/-/qRUmRymFVVEJ.
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/rails-oceania?hl=en.