aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/locking/optimistic.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 18:24:04 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:26:45 +0200
commit4df2b779ddfcb27761c71e00e2b241bfa06a0950 (patch)
tree7a83cce62195f7b20afea6d6a8873b953d25cb84 /activerecord/lib/active_record/locking/optimistic.rb
parenta731125f12c5834de7eae3455fad63ea4d348034 (diff)
downloadrails-4df2b779ddfcb27761c71e00e2b241bfa06a0950.tar.gz
rails-4df2b779ddfcb27761c71e00e2b241bfa06a0950.tar.bz2
rails-4df2b779ddfcb27761c71e00e2b241bfa06a0950.zip
applies new string literal convention in activerecord/lib
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'activerecord/lib/active_record/locking/optimistic.rb')
-rw-r--r--activerecord/lib/active_record/locking/optimistic.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb
index 67b8efac66..5e519056a3 100644
--- a/activerecord/lib/active_record/locking/optimistic.rb
+++ b/activerecord/lib/active_record/locking/optimistic.rb
@@ -63,7 +63,7 @@ module ActiveRecord
def increment_lock
lock_col = self.class.locking_column
previous_lock_value = send(lock_col).to_i
- send(lock_col + '=', previous_lock_value + 1)
+ send(lock_col + "=", previous_lock_value + 1)
end
def _create_record(attribute_names = self.attribute_names, *) # :nodoc:
@@ -106,7 +106,7 @@ module ActiveRecord
# If something went wrong, revert the version.
rescue Exception
- send(lock_col + '=', previous_lock_value)
+ send(lock_col + "=", previous_lock_value)
raise
end
end
@@ -133,7 +133,7 @@ module ActiveRecord
end
module ClassMethods
- DEFAULT_LOCKING_COLUMN = 'lock_version'
+ DEFAULT_LOCKING_COLUMN = "lock_version"
# Returns true if the +lock_optimistically+ flag is set to true
# (which it is, by default) and the table includes the
@@ -198,11 +198,11 @@ module ActiveRecord
end
def init_with(coder)
- __setobj__(coder['subtype'])
+ __setobj__(coder["subtype"])
end
def encode_with(coder)
- coder['subtype'] = __getobj__
+ coder["subtype"] = __getobj__
end
end
end