WIP 2
This commit is contained in:
parent
bc94408eaa
commit
5cb33b9df8
|
@ -691,6 +691,8 @@ unsupported association type :#{reflection.macro}.
|
|||
previous_value.to_datetime.next
|
||||
elsif boolean_value?(previous_value)
|
||||
!previous_value
|
||||
elsif previous_value.is_a?(ActiveRecord::Base)
|
||||
previous_value.class.new
|
||||
else
|
||||
previous_value.to_s.next
|
||||
end
|
||||
|
|
|
@ -20,6 +20,7 @@ module UnitTests
|
|||
fs.within_project do
|
||||
install_gems
|
||||
remove_unwanted_gems
|
||||
raise_errors_on_mass_assignment_violations
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -119,6 +120,14 @@ end
|
|||
end
|
||||
end
|
||||
|
||||
def raise_errors_on_mass_assignment_violations
|
||||
fs.write 'config/initializers/protected_attributes.rb', <<-CONTENT
|
||||
Rails.application.configure do
|
||||
config.active_record.mass_assignment_sanitizer = :strict
|
||||
end
|
||||
CONTENT
|
||||
end
|
||||
|
||||
def run_command!(*args)
|
||||
Tests::CommandRunner.run!(*args)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue