diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-05-12 16:13:00 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-05-12 16:13:00 -0300 |
commit | 0048897a417774f7e5a0c8c9e82fc8684f94ebc1 (patch) | |
tree | 8df248dab434bdaac61ea60249d4630958260eed /activerecord/lib/active_record/locking | |
parent | 6c7d8cb8ac9e6b6775e9a54ef0be62dbaab592f5 (diff) | |
parent | 22c5667c2ef46d6723c1805d3adc52dc8e92429b (diff) | |
download | rails-0048897a417774f7e5a0c8c9e82fc8684f94ebc1.tar.gz rails-0048897a417774f7e5a0c8c9e82fc8684f94ebc1.tar.bz2 rails-0048897a417774f7e5a0c8c9e82fc8684f94ebc1.zip |
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/lib/active_record/locking')
-rw-r--r-- | activerecord/lib/active_record/locking/optimistic.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb index a4f5dd8516..e51748b7d2 100644 --- a/activerecord/lib/active_record/locking/optimistic.rb +++ b/activerecord/lib/active_record/locking/optimistic.rb @@ -42,17 +42,17 @@ module ActiveRecord # To override the name of the lock_version column, invoke the <tt>set_locking_column</tt> method. # This method uses the same syntax as <tt>set_table_name</tt> module Optimistic - def self.included(base) #:nodoc: - base.extend ClassMethods + extend ActiveSupport::DependencyModule - base.cattr_accessor :lock_optimistically, :instance_writer => false - base.lock_optimistically = true + included do + cattr_accessor :lock_optimistically, :instance_writer => false + self.lock_optimistically = true - base.alias_method_chain :update, :lock - base.alias_method_chain :destroy, :lock - base.alias_method_chain :attributes_from_column_definition, :lock + alias_method_chain :update, :lock + alias_method_chain :destroy, :lock + alias_method_chain :attributes_from_column_definition, :lock - class << base + class << self alias_method :locking_column=, :set_locking_column end end |