Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 875689d550f28a5ce327310c51098443e1adcb03 1 parent 848c601
@senny senny authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 test/abstract_unit.rb
View
11 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
+end
+
+if active_support_4_0?
+ require 'active_support/core_ext/class/attribute_accessors'
+else
+ require 'active_support/core_ext/module/attribute_accessors'
+end
+
module SetupOnce
extend ActiveSupport::Concern
Please sign in to comment.
Something went wrong with that request. Please try again.