aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/mysql
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-04-09 04:41:28 +0900
committerGitHub <noreply@github.com>2019-04-09 04:41:28 +0900
commita497ece3f7046123cb7fe6720f08d40e4ca6019d (patch)
treec60622ef2aa070d520114cc0c321ae1196c5c2cc /activerecord/lib/active_record/connection_adapters/mysql
parent35d388b2e9639e5f1c1db032ded04dd5cda7bceb (diff)
parent20da6c7eac90526e1f93f8463bd5e12d1e6203a3 (diff)
downloadrails-a497ece3f7046123cb7fe6720f08d40e4ca6019d.tar.gz
rails-a497ece3f7046123cb7fe6720f08d40e4ca6019d.tar.bz2
rails-a497ece3f7046123cb7fe6720f08d40e4ca6019d.zip
Merge pull request #35887 from kamipo/argument_error
Raise `ArgumentError` for invalid `:limit` and `:precision` like as other options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/mysql')
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb
index a24c432893..25a1fb234a 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb
@@ -243,7 +243,7 @@ module ActiveRecord
when nil, 0x100..0xffff; nil
when 0x10000..0xffffff; "medium"
when 0x1000000..0xffffffff; "long"
- else raise ActiveRecordError, "No #{type} type has byte size #{limit}"
+ else raise ArgumentError, "No #{type} type has byte size #{limit}"
end
end
end
@@ -255,7 +255,7 @@ module ActiveRecord
when 3; "mediumint"
when nil, 4; "int"
when 5..8; "bigint"
- else raise ActiveRecordError, "No integer type has byte size #{limit}. Use a decimal with scale 0 instead."
+ else raise ArgumentError, "No integer type has byte size #{limit}. Use a decimal with scale 0 instead."
end
end
end