aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_set
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/attribute_set
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/attribute_set')
-rw-r--r--activerecord/lib/active_record/attribute_set/builder.rb2
-rw-r--r--activerecord/lib/active_record/attribute_set/yaml_encoder.rb8
2 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/attribute_set/builder.rb b/activerecord/lib/active_record/attribute_set/builder.rb
index 4ffd39d82d..b4d98ca3c0 100644
--- a/activerecord/lib/active_record/attribute_set/builder.rb
+++ b/activerecord/lib/active_record/attribute_set/builder.rb
@@ -1,4 +1,4 @@
-require 'active_record/attribute'
+require "active_record/attribute"
module ActiveRecord
class AttributeSet # :nodoc:
diff --git a/activerecord/lib/active_record/attribute_set/yaml_encoder.rb b/activerecord/lib/active_record/attribute_set/yaml_encoder.rb
index f9d527a5a3..52ffe719f4 100644
--- a/activerecord/lib/active_record/attribute_set/yaml_encoder.rb
+++ b/activerecord/lib/active_record/attribute_set/yaml_encoder.rb
@@ -8,7 +8,7 @@ module ActiveRecord
end
def encode(attribute_set, coder)
- coder['concise_attributes'] = attribute_set.each_value.map do |attr|
+ coder["concise_attributes"] = attribute_set.each_value.map do |attr|
if attr.type.equal?(default_types[attr.name])
attr.with_type(nil)
else
@@ -18,10 +18,10 @@ module ActiveRecord
end
def decode(coder)
- if coder['attributes']
- coder['attributes']
+ if coder["attributes"]
+ coder["attributes"]
else
- attributes_hash = Hash[coder['concise_attributes'].map do |attr|
+ attributes_hash = Hash[coder["concise_attributes"].map do |attr|
if attr.type.nil?
attr = attr.with_type(default_types[attr.name])
end