Browse files

get rid of AS attribute_accessors deprecation message.

The file was moved and we need to require a different path.
This change should only apply to Rails 4.1 and above.

This will eliminate the following deprecation message:

DEPRECATION WARNING: The cattr_* method definitions have been moved into active_support/core_ext/module/attribute_accessors. Please require that instead. (called from require at /Users/senny/Projects/protected_attributes/test/abstract_unit.rb:3)
  • Loading branch information...
1 parent 848c601 commit 875689d550f28a5ce327310c51098443e1adcb03 @senny senny committed Dec 11, 2013
Showing with 10 additions and 1 deletion.
  1. +10 −1 test/abstract_unit.rb
@@ -1,8 +1,17 @@
require 'action_dispatch'
require 'action_controller'
-require 'active_support/core_ext/class/attribute_accessors'
require 'active_support/dependencies'
+def active_support_4_0?
+ ActiveSupport::VERSION::MAJOR == 4 && ActiveSupport::VERSION::MINOR == 0
+if active_support_4_0?
+ require 'active_support/core_ext/class/attribute_accessors'
+ require 'active_support/core_ext/module/attribute_accessors'
module SetupOnce
extend ActiveSupport::Concern

0 comments on commit 875689d

Please sign in to comment.