diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-21 17:53:28 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-21 17:53:28 -0800 |
commit | 59f3218463228ca2301857cd7bf4f82f308924a6 (patch) | |
tree | a0f56c3b4f59b22014dac1bbf9444ebc640b6180 | |
parent | 3d6e223b8457a0bfae0debbc172cb44575a7858a (diff) | |
download | rails-59f3218463228ca2301857cd7bf4f82f308924a6.tar.gz rails-59f3218463228ca2301857cd7bf4f82f308924a6.tar.bz2 rails-59f3218463228ca2301857cd7bf4f82f308924a6.zip |
load and prefer psych as the YAML parser when it is available
-rw-r--r-- | activerecord/lib/active_record/base.rb | 5 | ||||
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/commands/dbconsole.rb | 6 |
3 files changed, 17 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 47dc2d4a3a..00324b14f2 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1,3 +1,8 @@ +begin + require 'psych' +rescue LoadError +end + require 'yaml' require 'set' require 'active_support/benchmarkable' diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index b6f0511b9a..216c691833 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -1,4 +1,10 @@ require 'erb' + +begin + require 'psych' +rescue LoadError +end + require 'yaml' require 'csv' require 'zlib' diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb index 14d245ab2e..300fd6da05 100644 --- a/railties/lib/rails/commands/dbconsole.rb +++ b/railties/lib/rails/commands/dbconsole.rb @@ -1,4 +1,10 @@ require 'erb' + +begin + require 'psych' +rescue LoadError +end + require 'yaml' require 'optparse' require 'rbconfig' |