search for: 343d

Displaying 1 result from an estimated 1 matches for "343d".

Did you mean: 343
2013 Jul 19
12
Rails 4 "belongs_to: record" association doesn't work
Hi, I discovered a weird behavior when using a "belongs_to: record" association in Rails 4. Given two models A and B: class A < ActiveRecord::Base belongs_to :record, class_name: ''B'', foreign_key: ''b_id'' end class B < ActiveRecord::Base end When creating A, it inserts a record in B and returns A with id of nil: irb(main):001:0>