Hi,

I added that and could get the bookings for a bed. but i wanted to get 
the bookings for a room using an association like:

room.bookings

i tried adding this using the nested has many plugin:

has_many :bookings, :through => :booking_items

to Room. but i got this error message.

Mysql::Error: Unknown column 
'booking_items.roomActiveRecord::StatementInvalid: Mysql::Error: Unknown 
column 'booking_items.room_id' in 'where clause': SELECT `bookings`.* 
FROM `bookings`    INNER JOIN booking_items ON bookings.id = 
booking_items.booking_id    WHERE ((`booking_items`.room_id = 1))


Am i better off just adding Room_Id to the BookingItem model and 
effectively denormalising it??

Thanks for the 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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to