aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-04-04 18:38:06 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-04-04 18:38:06 -0300
commite9e53415496dac22b65298f0eb1ba60725b3ecbb (patch)
tree9360e4659d4165858e76d94310e254171775823e /activerecord/test/cases
parentbc6a94902097b68482479acb49bdd03ba292a3e8 (diff)
parent9694f86de65e9162a6802a43cdbce9ccc85285b5 (diff)
downloadrails-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/cases')
-rw-r--r--activerecord/test/cases/associations/belongs_to_associations_test.rb18
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