aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
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/connection_adapters
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/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb11
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/oid/range.rb8
2 files changed, 9 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
index 92ac607a3c..cf0e3a260d 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -61,12 +61,11 @@ module ActiveRecord
def emit_warning_if_null_unspecified(options)
return if options.key?(:null)
- ActiveSupport::Deprecation.warn(<<-MESSAGE.strip_heredoc)
- `timestamp` was called without specifying an option for `null`. In Rails
- 5.0, this behavior will change to `null: false`. You should manually
- specify `null: true` to prevent the behavior of your existing migrations
- from changing.
- MESSAGE
+ ActiveSupport::Deprecation.warn \
+ "`timestamp` was called without specifying an option for `null`. In Rails " \
+ "5.0, this behavior will change to `null: false`. You should manually " \
+ "specify `null: true` to prevent the behavior of your existing migrations " \
+ "from changing."
end
end
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/range.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/range.rb
index ae967d5167..84b9490ba3 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/range.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/range.rb
@@ -25,10 +25,10 @@ module ActiveRecord
if !infinity?(from) && extracted[:exclude_start]
if from.respond_to?(:succ)
from = from.succ
- ActiveSupport::Deprecation.warn <<-MESSAGE
-Excluding the beginning of a Range is only partialy supported through `#succ`.
-This is not reliable and will be removed in the future.
- MESSAGE
+ ActiveSupport::Deprecation.warn \
+ "Excluding the beginning of a Range is only partialy supported " \
+ "through `#succ`. This is not reliable and will be removed in " \
+ "the future."
else
raise ArgumentError, "The Ruby Range object does not support excluding the beginning of a Range. (unsupported value: '#{value}')"
end