aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-02-01 08:42:22 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2015-02-01 08:42:22 -0800
commitaa8ade5811db1873a6091f3aa6282e77d22d9d3e (patch)
treeae6272f67eddcc6293579542c6e1e8dc993bd30f /activerecord
parent82e710f8471622bd3f3d1640e42ad14f9c9309b9 (diff)
parentfdeef19833ce47b03bcb792f1850f6233f050b9f (diff)
downloadrails-aa8ade5811db1873a6091f3aa6282e77d22d9d3e.tar.gz
rails-aa8ade5811db1873a6091f3aa6282e77d22d9d3e.tar.bz2
rails-aa8ade5811db1873a6091f3aa6282e77d22d9d3e.zip
Merge branch 'master' into mdluo-master
* master: Move required error message and changelog to Active Record Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846 Use Module#include instead of send :include, since now is a public method [ci skip] :scissors: warning from controller renderer test Conflicts: activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md5
-rw-r--r--activerecord/lib/active_record/fixtures.rb4
-rw-r--r--activerecord/lib/active_record/locale/en.yml1
3 files changed, 8 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index c834f4d5d5..a17148f1f7 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -2,6 +2,11 @@
*Sammy Larbi*
+* Change the default error message from `can't be blank` to `must exist` for
+ the presence validator of the `:required` option on `belongs_to`/`has_one` associations.
+
+ *Henrik Nygren*
+
* Fixed ActiveRecord::Relation#group method when argument is SQL reserved key word:
Example:
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index 57db2faaff..739be524da 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -132,7 +132,7 @@ module ActiveRecord
# Digest::SHA2.hexdigest(File.read(Rails.root.join('test/fixtures', path)))
# end
# end
- # ActiveRecord::FixtureSet.context_class.send :include, FixtureFileHelpers
+ # ActiveRecord::FixtureSet.context_class.include FixtureFileHelpers
#
# - use the helper method in a fixture
# photo:
@@ -522,7 +522,7 @@ module ActiveRecord
update_all_loaded_fixtures fixtures_map
connection.transaction(:requires_new => true) do
- deleted_tables = Set.new
+ deleted_tables = Set.new
fixture_sets.each do |fs|
conn = fs.model_class.respond_to?(:connection) ? fs.model_class.connection : connection
table_rows = fs.table_rows
diff --git a/activerecord/lib/active_record/locale/en.yml b/activerecord/lib/active_record/locale/en.yml
index b1fbd38622..8a3c27e6da 100644
--- a/activerecord/lib/active_record/locale/en.yml
+++ b/activerecord/lib/active_record/locale/en.yml
@@ -7,6 +7,7 @@ en:
# Default error messages
errors:
messages:
+ required: "must exist"
taken: "has already been taken"
# Active Record models configuration