[Rails] Re: has_many :through - additional attribute

2010-12-02 Thread Brett N.
I have the same case as stated here but I would like to know if there is an elegant way to set the attribute in the join model. I kno the join model is created automatically using user.companies << company I was wondering if there is a way to set the attribute in the join model at the same time

[Rails] Re: has_many :through - additional attribute

2010-11-27 Thread Markus Zm
Colin, > Does that help? Thank you very much. I think I've got it. It works in the console, and now I will try to implement it in my application. Regards, Markus -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on R

Re: [Rails] Re: has_many :through - additional attribute

2010-11-26 Thread Colin Law
On 26 November 2010 20:37, Markus Zm wrote: To repeat myself: Please don't top post, it makes it difficult to follow the thread. It is better to nsert your comments in appropriate places in previous post. Thanks. > My idea is that I have users, who are responsible for maintaining or for > revi

[Rails] Re: has_many :through - additional attribute

2010-11-26 Thread Markus Zm
My idea is that I have users, who are responsible for maintaining or for reviewing records relating to one or many companies. The other way round a company' records can be maintained or reviewed by many users. In the 'type' attribute I would like to store the role of the user as 'read-only' or '

Re: [Rails] Re: has_many :through - additional attribute

2010-11-26 Thread Colin Law
On 25 November 2010 21:18, Markus Zm wrote: Please don't top post, it makes it difficult to follow the thread. It is better to nsert your comments in appropriate places in previous post. Thanks. > Thanks! I will change the attribute name. > > But do I have to go via user/company.responsibles o

[Rails] Re: has_many :through - additional attribute

2010-11-25 Thread Markus Zm
Thanks! I will change the attribute name. But do I have to go via user/company.responsibles or could I also access the additional 'type' attribute via via user.companies or company.users after the creation of a new record using user.companies << company -- Posted via http://www.ruby-forum.com