aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/attribute.rb')
-rw-r--r--activerecord/lib/active_record/attribute.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute.rb b/activerecord/lib/active_record/attribute.rb
index 78662433eb..fc474edc15 100644
--- a/activerecord/lib/active_record/attribute.rb
+++ b/activerecord/lib/active_record/attribute.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ActiveRecord
class Attribute # :nodoc:
class << self
@@ -174,7 +176,7 @@ module ActiveRecord
end
def came_from_user?
- true
+ !type.value_constructed_by_mass_assignment?(value_before_type_cast)
end
end