04 May 2010, 13:38
Generic-user-small

Trung LE (3 posts)

Hi there,

I bumped into errors when trying to do ‘theater.movies’ in Rails console.

@
NoMethodError: undefined method `assert_valid_keys’ for :movie:Symbol from /Users/MAC/.rvm/gems/ree-1.8.7-2010.01/gems/activerecord-2.3.5/lib/active_record/associations.rb:1566:in `create_belongs_to_reflection’ from /Users/MAC/.rvm/gems/ree-1.8.7-2010.01/gems/activerecord-2.3.5/lib/active_record/associations.rb:1033:in `belongs_to’ from (eval):3:in `belongs_to’
@

I figured out the bug is due to Showing model, if I merge 2 models into 1 belongs_to like this belongs_to :movie, theater. To solve the problem I have to separate them into 2 lines. Why is that?

  You must be logged in to comment