Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Do not depend on railties, only load railtie if Rails is defined

Should allow people to require only Active Model mass assignment goodies.
  • Loading branch information...
commit 6886ec7b4c2431e5524e0b21088a873935acd795 1 parent a14cc6d
@carlosantoniodasilva carlosantoniodasilva authored
View
2  lib/protected_attributes.rb
@@ -1,5 +1,5 @@
require "active_model/mass_assignment_security"
-require "protected_attributes/railtie"
+require "protected_attributes/railtie" if defined? Rails
require "protected_attributes/version"
module ProtectedAttributes
View
2  lib/protected_attributes/railtie.rb
@@ -1,3 +1,5 @@
+require 'rails/railtie'
+
module ProtectedAttributes
class Railtie < ::Rails::Railtie
config.before_configuration do |app|
View
1  protected_attributes.gemspec
@@ -18,7 +18,6 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.add_dependency "activemodel", ">= 4.0.0.beta", "< 5.0"
- gem.add_dependency "railties", ">= 4.0.0.beta", "< 5.0"
gem.add_development_dependency "activerecord", ">= 4.0.0.beta", "< 5.0"
gem.add_development_dependency "actionpack", ">= 4.0.0.beta", "< 5.0"
Please sign in to comment.
Something went wrong with that request. Please try again.