From 45720c730087a4b5eb7ea64c17bdabf848ae630e Mon Sep 17 00:00:00 2001 From: Jesper Hvirring Henriksen Date: Mon, 2 Jun 2008 22:43:51 +0200 Subject: [PATCH] Added check for disabled frameworks before setting new Rails defaults --- .../configs/initializers/new_rails_defaults.rb | 22 +++++++++++-------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/railties/configs/initializers/new_rails_defaults.rb b/railties/configs/initializers/new_rails_defaults.rb index 5e60c0a..8a0a414 100644 --- a/railties/configs/initializers/new_rails_defaults.rb +++ b/railties/configs/initializers/new_rails_defaults.rb @@ -1,15 +1,19 @@ # These settings change the behavior of Rails 2 apps and will be defaults # for Rails 3. You can remove this initializer when Rails 3 is released. -# Include Active Record class name as root for JSON serialized output. -ActiveRecord::Base.include_root_in_json = true +if defined? ActiveRecord + # Include Active Record class name as root for JSON serialized output. + ActiveRecord::Base.include_root_in_json = true -# Store the full class name (including module namespace) in STI type column. -ActiveRecord::Base.store_full_sti_class = true + # Store the full class name (including module namespace) in STI type column. + ActiveRecord::Base.store_full_sti_class = true +end -# Use ISO 8601 format for JSON serialized times and dates. -ActiveSupport.use_standard_json_time_format = true +if defined? ActiveSupport + # Use ISO 8601 format for JSON serialized times and dates. + ActiveSupport.use_standard_json_time_format = true -# Don't escape HTML entities in JSON, leave that for the #json_escape helper. -# if you're including raw json in an HTML page. -ActiveSupport.escape_html_entities_in_json = false \ No newline at end of file + # Don't escape HTML entities in JSON, leave that for the #json_escape helper. + # if you're including raw json in an HTML page. + ActiveSupport.escape_html_entities_in_json = false +end -- 1.5.5.1