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/associations/builder/singular_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/builder/singular_association.rb b/activerecord/lib/active_record/associations/builder/singular_association.rb
index 1369212837..f6274c027e 100644
--- a/activerecord/lib/active_record/associations/builder/singular_association.rb
+++ b/activerecord/lib/active_record/associations/builder/singular_association.rb
@@ -31,7 +31,7 @@ module ActiveRecord::Associations::Builder
def self.define_validations(model, reflection)
super
if reflection.options[:required]
- model.validates_presence_of reflection.name
+ model.validates_presence_of reflection.name, message: :required
end
end
end