aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-03-27 08:56:04 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-03-27 08:56:04 -0700
commit30fbbb4ce37846c43ba9dc4b29102f121cb005a4 (patch)
tree62ea46ff0f31292806187e10ab3b50a4cde9a5ee /activerecord/lib
parent642ecd5cbea87b90c1ab2d2bebbb745ac3ac9670 (diff)
parentb2f7c460767c2ce544d80399ce7d0d2cbc3aa7cb (diff)
downloadrails-30fbbb4ce37846c43ba9dc4b29102f121cb005a4.tar.gz
rails-30fbbb4ce37846c43ba9dc4b29102f121cb005a4.tar.bz2
rails-30fbbb4ce37846c43ba9dc4b29102f121cb005a4.zip
Merge pull request #9949 from vipulnsward/drop_yaml_error_constant
drop errors constant
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/coders/yaml_column.rb3
-rw-r--r--activerecord/lib/active_record/fixture_set/file.rb3
2 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/coders/yaml_column.rb b/activerecord/lib/active_record/coders/yaml_column.rb
index f6cdc67b4d..8d22942a06 100644
--- a/activerecord/lib/active_record/coders/yaml_column.rb
+++ b/activerecord/lib/active_record/coders/yaml_column.rb
@@ -3,7 +3,6 @@ require 'yaml'
module ActiveRecord
module Coders # :nodoc:
class YAMLColumn # :nodoc:
- RESCUE_ERRORS = [ ArgumentError, Psych::SyntaxError ]
attr_accessor :object_class
@@ -34,7 +33,7 @@ module ActiveRecord
obj ||= object_class.new if object_class != Object
obj
- rescue *RESCUE_ERRORS
+ rescue ArgumentError, Psych::SyntaxError
yaml
end
end
diff --git a/activerecord/lib/active_record/fixture_set/file.rb b/activerecord/lib/active_record/fixture_set/file.rb
index 11b53275e1..fbd7a4d891 100644
--- a/activerecord/lib/active_record/fixture_set/file.rb
+++ b/activerecord/lib/active_record/fixture_set/file.rb
@@ -24,7 +24,6 @@ module ActiveRecord
rows.each(&block)
end
- RESCUE_ERRORS = [ ArgumentError, Psych::SyntaxError ] # :nodoc:
private
def rows
@@ -32,7 +31,7 @@ module ActiveRecord
begin
data = YAML.load(render(IO.read(@file)))
- rescue *RESCUE_ERRORS => error
+ rescue ArgumentError, Psych::SyntaxError => error
raise Fixture::FormatError, "a YAML error occurred parsing #{@file}. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html\nThe exact error was:\n #{error.class}: #{error}", error.backtrace
end
@rows = data ? validate(data).to_a : []