Ruby on Rails Tuesday, June 1, 2010

On 31 May 2010 22:43, Paul A. <lists@ruby-forum.com> wrote:
> Hi,
>
> I have an ActiveRecord model Group and a YAML table stored in
> config/users.yaml just like:
>
>    - {login: titi, password: 123456, group_id: 2}
>    - {login: toto, password: 987654, group_id: 7}
>
> And I would like to link them by a sexy way.  Can you help me?
>
> I would be happy if I can do this (as example): User.first.group.id # =>
> 2

You could run a rake task to put the data in the database, unless
there is a good reason why you need it in a yaml file.

Colin

>
> Many thanks for any help!
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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.
>
>

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