Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

some modifications to lib/active_model #4597

Closed
wants to merge 1 commit into from

2 participants

Sachin Singh José Valim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 22, 2012
  1. Sachin Singh
This page is out of date. Refresh to see the latest.
3  activemodel/lib/active_model/errors.rb
View
@@ -326,8 +326,7 @@ def generate_message(attribute, type = :invalid, options = {})
defaults << :"errors.attributes.#{attribute}.#{type}"
defaults << :"errors.messages.#{type}"
- defaults.compact!
- defaults.flatten!
+ defaults.compact!.flatten!
key = defaults.shift
value = (attribute != :base ? @base.send(:read_attribute_for_validation, attribute) : nil)
5 activemodel/lib/active_model/mass_assignment_security/sanitizer.rb
View
@@ -31,7 +31,7 @@ def logger
end
def logger?
- @target.respond_to?(:logger) && @target.logger
+ @target.respond_to?(:logger) && logger
end
def process_removed_attributes(attrs)
@@ -40,9 +40,6 @@ def process_removed_attributes(attrs)
end
class StrictSanitizer < Sanitizer
- def initialize(target = nil)
- super()
- end
def process_removed_attributes(attrs)
return if (attrs - insensitive_attributes).empty?
2  activemodel/test/cases/mass_assignment_security/sanitizer_test.rb
View
@@ -13,7 +13,7 @@ def deny?(key)
def setup
@logger_sanitizer = ActiveModel::MassAssignmentSecurity::LoggerSanitizer.new(self)
- @strict_sanitizer = ActiveModel::MassAssignmentSecurity::StrictSanitizer.new(self)
+ @strict_sanitizer = ActiveModel::MassAssignmentSecurity::StrictSanitizer.new
@authorizer = Authorizer.new
end
Something went wrong with that request. Please try again.