aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/read.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/attribute_methods/read.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/attribute_methods/read.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods/read.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb
index 10869dfc1e..bf2a084a00 100644
--- a/activerecord/lib/active_record/attribute_methods/read.rb
+++ b/activerecord/lib/active_record/attribute_methods/read.rb
@@ -46,9 +46,7 @@ module ActiveRecord
protected
def cached_attributes_deprecation_warning(method_name)
- ActiveSupport::Deprecation.warn(<<-MESSAGE.strip_heredoc)
- Calling `#{method_name}` is no longer necessary. All attributes are cached.
- MESSAGE
+ ActiveSupport::Deprecation.warn "Calling `#{method_name}` is no longer necessary. All attributes are cached."
end
if Module.methods_transplantable?