aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_many_through_association.rb
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-08-28 09:19:11 -0700
committerGodfrey Chan <godfreykfc@gmail.com>2014-08-28 09:19:11 -0700
commit8c52480ba6071a12b97f124d9f21df2c39df3ed3 (patch)
treeb0c41cbee61c699f74ae6a09dbab4b604f8df122 /activerecord/lib/active_record/associations/has_many_through_association.rb
parent4e68c5dc5712e1d560d3ade694e3f840637baa47 (diff)
downloadrails-8c52480ba6071a12b97f124d9f21df2c39df3ed3.tar.gz
rails-8c52480ba6071a12b97f124d9f21df2c39df3ed3.tar.bz2
rails-8c52480ba6071a12b97f124d9f21df2c39df3ed3.zip
Avoid using heredoc for user warnings
Using heredoc would enforce line wrapping to whatever column width we decided to use in the code, making it difficult for the users to read on some consoles. This does make the source code read slightly worse and a bit more error-prone, but this seems like a fair price to pay since the primary purpose for these messages are for the users to read and the code will not stick around for too long.
Diffstat (limited to 'activerecord/lib/active_record/associations/has_many_through_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_many_through_association.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb
index 44c4436e95..0968b0068e 100644
--- a/activerecord/lib/active_record/associations/has_many_through_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_through_association.rb
@@ -63,12 +63,12 @@ module ActiveRecord
save_through_record(record)
if has_cached_counter? && !through_reflection_updates_counter_cache?
- ActiveSupport::Deprecation.warn(<<-MESSAGE.strip_heredoc)
- Automatic updating of counter caches on through associations has been
- deprecated, and will be removed in Rails 5.0. Instead, please set the
- appropriate counter_cache options on the has_many and belongs_to for
- your associations to #{through_reflection.name}.
- MESSAGE
+ ActiveSupport::Deprecation.warn \
+ "Automatic updating of counter caches on through associations has been " \
+ "deprecated, and will be removed in Rails 5.0. Instead, please set the " \
+ "appropriate counter_cache options on the has_many and belongs_to for " \
+ "your associations to #{through_reflection.name}."
+
update_counter_in_database(1)
end
record