diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2013-07-29 09:22:14 +0530 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2014-02-20 10:34:52 +0530 |
commit | 9694f86de65e9162a6802a43cdbce9ccc85285b5 (patch) | |
tree | 754cd6e873fadfb4a07f917744038bf830703dfe /activerecord/lib/active_record/associations/singular_association.rb | |
parent | 25ce856c3ea8beb864994b4b13df07b48574df9b (diff) | |
download | rails-9694f86de65e9162a6802a43cdbce9ccc85285b5.tar.gz rails-9694f86de65e9162a6802a43cdbce9ccc85285b5.tar.bz2 rails-9694f86de65e9162a6802a43cdbce9ccc85285b5.zip |
[Active Record] Renamed private methods create_record and update_record
This is to ensure that they are not accidentally called by the app code.
They are renamed to _create_record and _update_record respectively.
Closes #11645
Diffstat (limited to 'activerecord/lib/active_record/associations/singular_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/singular_association.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/singular_association.rb b/activerecord/lib/active_record/associations/singular_association.rb index 399aff378a..747bb5f1d6 100644 --- a/activerecord/lib/active_record/associations/singular_association.rb +++ b/activerecord/lib/active_record/associations/singular_association.rb @@ -18,11 +18,11 @@ module ActiveRecord end def create(attributes = {}, &block) - create_record(attributes, &block) + _create_record(attributes, &block) end def create!(attributes = {}, &block) - create_record(attributes, true, &block) + _create_record(attributes, true, &block) end def build(attributes = {}) @@ -52,7 +52,7 @@ module ActiveRecord replace(record) end - def create_record(attributes, raise_error = false) + def _create_record(attributes, raise_error = false) record = build_record(attributes) yield(record) if block_given? saved = record.save |