aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/attribute_set/builder.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/attribute_set/builder.rb b/activerecord/lib/active_record/attribute_set/builder.rb
index 60154a0647..b433205af3 100644
--- a/activerecord/lib/active_record/attribute_set/builder.rb
+++ b/activerecord/lib/active_record/attribute_set/builder.rb
@@ -35,11 +35,7 @@ module ActiveRecord
end
def [](key)
- if delegate_hash.key?(key)
- delegate_hash[key]
- else
- assign_default_value(key)
- end
+ delegate_hash[key] || assign_default_value(key)
end
def []=(key, value)