Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed asset precompilation out of the box but requires git source on …

…orm_adapter until my pull request is merged.

Pull Request: ianwhite/orm_adapter#10
  • Loading branch information...
commit 456d2c4e8f7ee2b1a4968aa0f47ac28106597d30 1 parent 06c142f
@parndt parndt authored ugisozols committed
Showing with 39 additions and 32 deletions.
  1. +4 −0 Gemfile
  2. +35 −32 authentication/config/routes.rb
View
4 Gemfile
@@ -12,6 +12,10 @@ gem 'paper_trail', :git => 'git://github.com/parndt/paper_trail.git', :branch =>
# See: https://github.com/svenfuchs/globalize3/pull/121
gem 'globalize3', :git => 'git://github.com/svenfuchs/globalize3.git', :branch => 'master'
+# For asset precompilation support out of the box.
+gem 'orm_adapter', :git => 'git://github.com/parndt/orm_adapter.git',
+ :branch => 'respect_active_support_on_load_hook_for_active_record'
+
# Database Configuration
platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter'
View
67 authentication/config/routes.rb
@@ -1,37 +1,40 @@
-Refinery::Core::Engine.routes.draw do
- begin
- devise_for :refinery_user,
- :class_name => 'Refinery::User',
- :path => 'refinery/users',
- :controllers => { :registrations => 'refinery/users' },
- :skip => [:registrations],
- :path_names => { :sign_out => 'logout',
- :sign_in => 'login',
- :sign_up => 'register' }
-
- # Override Devise's other routes for convenience methods.
- devise_scope :refinery_user do
- get '/refinery/login', :to => "sessions#new", :as => :new_refinery_user_session
- get '/refinery/logout', :to => "sessions#destroy", :as => :destroy_refinery_user_session
- get '/refinery/users/register' => 'users#new', :as => :new_refinery_user_registration
- post '/refinery/users/register' => 'users#create', :as => :refinery_user_registration
- end
- rescue RuntimeError => exc
- if exc.message =~ /ORM/
- # We don't want to complain on a fresh installation.
- if (ARGV || []).exclude?('--fresh-installation')
- puts "---\nYou can safely ignore the following warning if you're currently installing Refinery as Devise support files have not yet been copied to your application:\n\n"
- puts exc.message
- puts '---'
- end
- else
- raise exc
- end
- end
-end
-
Refinery::Core::Engine.routes.append do
namespace :admin, :path => 'refinery' do
resources :users, :except => :show
end
end
+
+ActiveSupport.on_load(:active_record) do
+ Refinery::Core::Engine.routes.draw do
+ begin
+ require 'devise'
+ devise_for :refinery_user,
+ :class_name => 'Refinery::User',
+ :path => 'refinery/users',
+ :controllers => { :registrations => 'refinery/users' },
+ :skip => [:registrations],
+ :path_names => { :sign_out => 'logout',
+ :sign_in => 'login',
+ :sign_up => 'register' }
+
+ # Override Devise's other routes for convenience methods.
+ devise_scope :refinery_user do
+ get '/refinery/login', :to => "sessions#new", :as => :new_refinery_user_session
+ get '/refinery/logout', :to => "sessions#destroy", :as => :destroy_refinery_user_session
+ get '/refinery/users/register' => 'users#new', :as => :new_refinery_user_registration
+ post '/refinery/users/register' => 'users#create', :as => :refinery_user_registration
+ end
+ rescue RuntimeError => exc
+ if exc.message =~ /ORM/
+ # We don't want to complain on a fresh installation.
+ if (ARGV || []).exclude?('--fresh-installation')
+ puts "---\nYou can safely ignore the following warning if you're currently installing Refinery as Devise support files have not yet been copied to your application:\n\n"
+ puts exc.message
+ puts '---'
+ end
+ else
+ raise exc
+ end
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.