Skip to content

Instantly share code, notes, and snippets.

@cyrill62
Last active September 19, 2015 08:34
Show Gist options
  • Save cyrill62/acf8a4ba6c48906106ee to your computer and use it in GitHub Desktop.
Save cyrill62/acf8a4ba6c48906106ee to your computer and use it in GitHub Desktop.
decent_exposure + reform attributes protection fail.
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