aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2018-06-06 09:35:02 +0900
committerGitHub <noreply@github.com>2018-06-06 09:35:02 +0900
commitd0d3e964920602aa710507f6717010d852e37c86 (patch)
tree61497e74a4dd5f0ea70b4d46b456009026c9da44 /activemodel/lib
parentc4c8e35cac419076a86112d7764f2afdef554483 (diff)
parenta46dcb7454b56c979cded85f2f4f875dcd2cfdf0 (diff)
downloadrails-d0d3e964920602aa710507f6717010d852e37c86.tar.gz
rails-d0d3e964920602aa710507f6717010d852e37c86.tar.bz2
rails-d0d3e964920602aa710507f6717010d852e37c86.zip
Merge pull request #33051 from SamSaffron/master
PERF: avoid allocating column names where possible
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/attributes.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/attributes.rb b/activemodel/lib/active_model/attributes.rb
index 7d44f7f2a3..5bf213d593 100644
--- a/activemodel/lib/active_model/attributes.rb
+++ b/activemodel/lib/active_model/attributes.rb
@@ -103,7 +103,7 @@ module ActiveModel
def self.set_name_cache(name, value)
const_name = "ATTR_#{name}"
unless const_defined? const_name
- const_set const_name, value.dup.freeze
+ const_set const_name, -value
end
end
}