On Tuesday, September 17, 2013 7:58:42 AM UTC-7, Rodrigo Rosenfeld Rosas
wrote:
>
> I was thinking about something like this in Pg:
>
> select username,
> array_to_string(array(
> select name from roles where id in (select role_id from
> user_roles where user_id=users.id)
> ), ', ') as user_roles
> from users limit 10;
>
> Is it possible to add such a column description somehow using your gem?
>
>
Well, you might be able to do:
@scaffold_browse_fields = [:username, :user_roles]
def user_roles
# do query, return string
end
That's going to do a separate query per row though. I don't believe
scaffolding extensions offers the ability to customize the query used in a
manner similar to what you want.
Thanks,
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.