Skip to content

Commit

Permalink
Rails 3 config.ru, new files, config.to_prepare workaround, activerec…
Browse files Browse the repository at this point in the history
…ord require fix
  • Loading branch information
jeremy committed Nov 11, 2009
1 parent 6304fde commit 6610929
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 3 deletions.
5 changes: 5 additions & 0 deletions config.ru
@@ -0,0 +1,5 @@
# Require your environment file to bootstrap Rails
require ::File.expand_path('../config/environment', __FILE__)

# Dispatch the request
run Rails.application
3 changes: 1 addition & 2 deletions config/initializers/10-patches.rb
@@ -1,5 +1,4 @@

require 'activerecord'
require 'active_record'

module ActiveRecord
class Base
Expand Down
5 changes: 5 additions & 0 deletions config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
# Be sure to restart your server when you modify this file.

# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
19 changes: 19 additions & 0 deletions config/initializers/new_rails_defaults.rb
@@ -0,0 +1,19 @@
# Be sure to restart your server when you modify this file.

# 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.

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
end

# 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
7 changes: 7 additions & 0 deletions db/seeds.rb
@@ -0,0 +1,7 @@
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
# Mayor.create(:name => 'Daley', :city => cities.first)
27 changes: 27 additions & 0 deletions public/422.html
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>The change you wanted was rejected (422)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
</style>
</head>

<body>
<!-- This file lives in public/422.html -->
<div class="dialog">
<h1>The change you wanted was rejected.</h1>
<p>Maybe you tried to change something you didn't have access to.</p>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion vendor/plugins/open_id_authentication/init.rb
Expand Up @@ -9,7 +9,7 @@
end

if Object.const_defined?(:OpenID)
config.to_prepare do
ActionDispatch::Callbacks.to_prepare do
OpenID::Util.logger = Rails.logger
ActionController::Base.send :include, OpenIdAuthentication
end
Expand Down

0 comments on commit 6610929

Please sign in to comment.