Entry.joins(:program => :user).group('programs.user_id') -> works in MySQL,
not Postgresql
Entry.joins(:program => :user).select('distinct on (programs.user_id)
entries.*') -> works in pg, not mysql
and an entry belongs to a program.
I'd like all entries with only one occurrence by user (program_id could also
do the trick I guess, but that is not the point).
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/zJTQ8-xY8FQJ.
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.