whiny-mass-assignment 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new( 'whiny-mass-assignment', '0.2.
|
5
|
+
Echoe.new( 'whiny-mass-assignment', '0.2.1', ) do |p|
|
6
6
|
p.description = "Complain loudly when protected attributes are set through mass assignment."
|
7
7
|
p.url = "https://github.com/appsinyourpants/whiny-mass-assignment"
|
8
8
|
p.author = "Paul Alexander"
|
@@ -15,10 +15,10 @@ module ActiveModel
|
|
15
15
|
return if WhinyMassAssignment::Config.whitelist[:mode] == :none
|
16
16
|
only = WhinyMassAssignment::Config.whitelist[:only]
|
17
17
|
if only
|
18
|
-
return unless only.include?( self.class )
|
18
|
+
return unless [only].flatten().include?( self.class )
|
19
19
|
else
|
20
20
|
except = WhinyMassAssignment::Config.whitelist[:except]
|
21
|
-
return if except && except.include?( self.class )
|
21
|
+
return if except && [except].flatten().include?( self.class )
|
22
22
|
end
|
23
23
|
|
24
24
|
self.logger.debug WhinyMassAssignment::bc :yellow, "Mass assignment whitelisting has not been specified for #{ WhinyMassAssignment::c [:bright, :red], self.class.name }" if self.logger
|