This commit is contained in:
Elliot Winkler 2016-01-24 18:57:48 -07:00
parent bc94408eaa
commit 5cb33b9df8
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -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