diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2011-01-09 10:15:05 -0800 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-01-31 19:45:53 -0200 |
commit | 57bc25c5f8129f57b08a2dc7c319b86778dd8a40 (patch) | |
tree | 4e21728c5dd1866f654ed88d169552a77fa6483b /activerecord/lib/active_record | |
parent | 9666b6a625c9fef555c2a18df6721fed2000f131 (diff) | |
download | rails-57bc25c5f8129f57b08a2dc7c319b86778dd8a40.tar.gz rails-57bc25c5f8129f57b08a2dc7c319b86778dd8a40.tar.bz2 rails-57bc25c5f8129f57b08a2dc7c319b86778dd8a40.zip |
Use run_callbacks; the generated _run_<name>_callbacks method is not a public interface.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activerecord/lib/active_record')
4 files changed, 11 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 00324b14f2..220d861a27 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1400,7 +1400,7 @@ MSG self.attributes = attributes unless attributes.nil? result = yield self if block_given? - _run_initialize_callbacks + run_callbacks :initialize result end @@ -1437,8 +1437,8 @@ MSG @aggregation_cache = {} @readonly = @destroyed = @marked_for_destruction = false @new_record = false - _run_find_callbacks - _run_initialize_callbacks + run_callbacks :find + run_callbacks :initialize end # Specifies how the record is dumped by +Marshal+. diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index 47428cfd0f..8f137e3b21 100644 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -237,25 +237,25 @@ module ActiveRecord end def destroy #:nodoc: - _run_destroy_callbacks { super } + run_callbacks(:destroy) { super } end def touch(*) #:nodoc: - _run_touch_callbacks { super } + run_callbacks(:touch) { super } end private def create_or_update #:nodoc: - _run_save_callbacks { super } + run_callbacks(:save) { super } end def create #:nodoc: - _run_create_callbacks { super } + run_callbacks(:create) { super } end def update(*) #:nodoc: - _run_update_callbacks { super } + run_callbacks(:update) { super } end end end diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb index cffa2387de..54f70c59f8 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -212,7 +212,7 @@ module ActiveRecord # calling +checkout+ on this pool. def checkin(conn) @connection_mutex.synchronize do - conn.send(:_run_checkin_callbacks) do + conn.run_callbacks :checkin do @checked_out.delete conn @queue.signal end diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index 48d2f7c9a9..45a4425944 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -259,7 +259,7 @@ module ActiveRecord # Call the after_commit callbacks def committed! #:nodoc: - _run_commit_callbacks + run_callbacks :commit ensure clear_transaction_record_state end @@ -267,7 +267,7 @@ module ActiveRecord # Call the after rollback callbacks. The restore_state argument indicates if the record # state should be rolled back to the beginning or just to the last savepoint. def rolledback!(force_restore_state = false) #:nodoc: - _run_rollback_callbacks + run_callbacks :rollback ensure restore_transaction_record_state(force_restore_state) end |