Skip to content

Commit

Permalink
fixes a few issues with railsengine.rb
Browse files Browse the repository at this point in the history
a) Authorization::Engine is already defined in authorization.rb.
Therefore, we must (I believe) rename the Authorization::Engine rail tie.
b) authorization.rb required railsengine.rb which required
lib/declarative_authorization.rb.  This dependency chain made it
impossible to select which pieces from declarative auth you want (if
you're not using ActiveRecord, loading in_model.rb will fail, and
lib/declarative_authorization.rb makes such an attempt).

Signed-off-by: Steffen Bartsch <sbartsch@tzi.org>
  • Loading branch information
timcharper authored and stffn committed May 2, 2010
1 parent bbb8acb commit 3d7dce3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/declarative_authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
raise "declarative_authorization requires Rails #{min_rails_version}. You are using #{Rails::VERSION::STRING}."
end

require File.join(%w{declarative_authorization railsengine}) if defined?(::Rails::Engine)

ActionController::Base.send :include, Authorization::AuthorizationInController
ActionController::Base.helper Authorization::AuthorizationHelper

Expand Down
1 change: 0 additions & 1 deletion lib/declarative_authorization/authorization.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Authorization
require File.dirname(__FILE__) + '/railsengine' if defined?(::Rails::Engine)
require File.dirname(__FILE__) + '/reader.rb'
require "set"

Expand Down
3 changes: 1 addition & 2 deletions lib/declarative_authorization/railsengine.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'declarative_authorization'
require 'rails'

module Authorization
class Engine < Rails::Engine
class RailsEngine < Rails::Engine
end
end

0 comments on commit 3d7dce3

Please sign in to comment.