forked from stffn/declarative_authorization
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dependancies from ActiveRecord removed. It must work with ActiveModel…
… now.
- Loading branch information
1 parent
0c7d8f7
commit 79ccff3
Showing
2 changed files
with
1,701 additions
and
1,701 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
require File.join(%w{declarative_authorization rails_legacy}) | ||
require File.join(%w{declarative_authorization helper}) | ||
require File.join(%w{declarative_authorization in_controller}) | ||
require File.join(%w{declarative_authorization in_model}) | ||
require File.join(%w{declarative_authorization obligation_scope}) | ||
#require File.join(%w{declarative_authorization in_model}) | ||
#require File.join(%w{declarative_authorization obligation_scope}) | ||
|
||
min_rails_version = "2.1.0" | ||
if Rails::VERSION::STRING < min_rails_version | ||
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) | ||
#require File.join(%w{declarative_authorization railsengine}) if defined?(::Rails::Engine) | ||
|
||
ActionController::Base.send :include, Authorization::AuthorizationInController | ||
ActionController::Base.helper Authorization::AuthorizationHelper | ||
|
||
ActiveRecord::Base.send :include, Authorization::AuthorizationInModel | ||
#ActiveRecord::Base.send :include, Authorization::AuthorizationInModel |
Oops, something went wrong.
79ccff3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be great to have ActiveRecord support on by default and a switch to disable the dependency. Alternatively, we could just deactivate the dependency if AR is not available. Then, AR-related tests could be disabled with an environment variable.
79ccff3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I am not so experienced in framework design and meta programming (for example to check the availability of AR). My intension was to "quick&dirty" proof if declarative_authorization will work with Active Model (Couch DB based). It does work!
Please let me know if I could support what you are talking about. To test it with my code or so.
Thanks for the good framework!