Wednesday, June 13, 2012

Re: [Rails] how to update a table which is connected with joins

hi all help me out guys


thanks in advance

On Tue, Jun 12, 2012 at 3:07 PM, hanish jadala <emailtohoneyruby@gmail.com> wrote:
no with our changing the relationship can i update values.


thanks in advance


On Tue, Jun 12, 2012 at 3:02 PM, Michael Pavling <pavling@gmail.com> wrote:
On 12 June 2012 10:31, honey ruby <emailtohoneyruby@gmail.com> wrote:
>
> hi all there are two tables Student and Batch in there model i have
> has_and_belongs_to_many :graduated_batches, :class_name => 'Batch',
> :join_table => 'batch_students' in Student table
> i have added a new column to batch_students table and i want to update the
> value in batch_students table. How can i update values in batch_students
> table where there is no model for that table so that i can update
> directly.how to update table which is in joins.


Sounds like you want to change those habtm relationships to "has_many
:through => :batch_students"

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate