diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-04 18:38:06 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-04 18:38:06 -0300 |
commit | e9e53415496dac22b65298f0eb1ba60725b3ecbb (patch) | |
tree | 9360e4659d4165858e76d94310e254171775823e /activerecord/test | |
parent | bc6a94902097b68482479acb49bdd03ba292a3e8 (diff) | |
parent | 9694f86de65e9162a6802a43cdbce9ccc85285b5 (diff) | |
download | rails-e9e53415496dac22b65298f0eb1ba60725b3ecbb.tar.gz rails-e9e53415496dac22b65298f0eb1ba60725b3ecbb.tar.bz2 rails-e9e53415496dac22b65298f0eb1ba60725b3ecbb.zip |
Merge pull request #11650 from prathamesh-sonpatki/rename
Renamed private methods _create_record and _update_record
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/belongs_to_associations_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index a65f2da7a0..091c94676e 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -885,4 +885,22 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase end end end + + test 'belongs_to works with model name Record' do + Record = Class.new(ActiveRecord::Base) do + connection.create_table :records + end + + Foo = Class.new(ActiveRecord::Base) do + connection.create_table :foos do |t| + t.belongs_to :record + end + + belongs_to :record + end + + record = Record.create! + Foo.create! record: record + assert_equal 1, Foo.count + end end |