diff --git a/lib/priceable.rb b/lib/priceable.rb index 405d431..3b8f5c2 100644 --- a/lib/priceable.rb +++ b/lib/priceable.rb @@ -17,9 +17,13 @@ def priceable(*price_fields) send("#{price_field}#{suffix}=".to_sym, (new_price.to_f * 100).round) end end - if self._accessible_attributes? - attr_accessible *price_fields + + unless Rails::VERSION::MAJOR == 4 && !defined?(ProtectedAttributes) + if self._accessible_attributes? + attr_accessible *price_fields + end end + end end