Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #146 from bterkuile/master

Allow declarative_authorization to be used without ActiveRecord
  • Loading branch information...
commit 86b521f24a60bd4c4b136c7b84150fb0b3487b88 2 parents 4819d0c + a1db63a
@stffn authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/declarative_authorization.rb
View
8 lib/declarative_authorization.rb
@@ -1,8 +1,10 @@
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})
+if defined?(ActiveRecord)
+ require File.join(%w{declarative_authorization in_model})
+ require File.join(%w{declarative_authorization obligation_scope})
+end
min_rails_version = "2.1.0"
if Rails::VERSION::STRING < min_rails_version
@@ -14,4 +16,4 @@
ActionController::Base.send :include, Authorization::AuthorizationInController
ActionController::Base.helper Authorization::AuthorizationHelper
-ActiveRecord::Base.send :include, Authorization::AuthorizationInModel
+ActiveRecord::Base.send :include, Authorization::AuthorizationInModel if defined?(ActiveRecord)
Please sign in to comment.
Something went wrong with that request. Please try again.