Last active
September 19, 2015 08:34
-
-
Save cyrill62/acf8a4ba6c48906106ee to your computer and use it in GitHub Desktop.
decent_exposure + reform attributes protection fail.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Model < ActiveRecord::Base | |
end | |
class ModelForm | |
property :a | |
property :b | |
end | |
model = Model.new | |
model.attributes = { a: 1, b: 2, c: 3 } | |
form = ModelForm.new(model) | |
form.validate(a: 1, b: 2, c: 3) | |
form.save | |
model.reload.c # => 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment