diff options
author | eileencodes <eileencodes@gmail.com> | 2018-02-21 16:34:39 -0500 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2018-02-21 16:34:39 -0500 |
commit | 63d530c5e68a8cf53603744789f53ccbc7ac1a0e (patch) | |
tree | 2b4edcdc3ac5c8d7c95b451a25d8111791c054bc | |
parent | 16f279ebd474626577ced858e3626ac4535a33df (diff) | |
download | rails-63d530c5e68a8cf53603744789f53ccbc7ac1a0e.tar.gz rails-63d530c5e68a8cf53603744789f53ccbc7ac1a0e.tar.bz2 rails-63d530c5e68a8cf53603744789f53ccbc7ac1a0e.zip |
Call `YAML.load` correctly
We should call methods with `.method_name` not `::method_name`. Fix two
instances of `YAML::load` I found in favor of `YAML.load`.
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/xml_mini.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 2e55713311..662a8bc720 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -229,7 +229,7 @@ db_namespace = namespace :db do base_dir = ActiveRecord::Tasks::DatabaseTasks.fixtures_path Dir["#{base_dir}/**/*.yml"].each do |file| - if data = YAML::load(ERB.new(IO.read(file)).result) + if data = YAML.load(ERB.new(IO.read(file)).result) data.each_key do |key| key_id = ActiveRecord::FixtureSet.identify(key) diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb index d0659aeaae..e42eee07a3 100644 --- a/activesupport/lib/active_support/xml_mini.rb +++ b/activesupport/lib/active_support/xml_mini.rb @@ -79,7 +79,7 @@ module ActiveSupport end, "boolean" => Proc.new { |boolean| %w(1 true).include?(boolean.to_s.strip) }, "string" => Proc.new { |string| string.to_s }, - "yaml" => Proc.new { |yaml| YAML::load(yaml) rescue yaml }, + "yaml" => Proc.new { |yaml| YAML.load(yaml) rescue yaml }, "base64Binary" => Proc.new { |bin| ::Base64.decode64(bin) }, "binary" => Proc.new { |bin, entity| _parse_binary(bin, entity) }, "file" => Proc.new { |file, entity| _parse_file(file, entity) } |