Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mass_assign_any_attribute seems broken #114

Open
jonathanhall opened this issue Sep 1, 2011 · 5 comments
Open

mass_assign_any_attribute seems broken #114

jonathanhall opened this issue Sep 1, 2011 · 5 comments
Labels

Comments

@jonathanhall
Copy link
Contributor

'mass_assign_any_attribute true' in the model seems broken.

It allows you to add the properties to a model instance, but 'changed?' is false, so the document does not get saved.

By using 'couchrest_attribute_will_change!' before a save/update call it works as expected

using 1.1.2 and rails 3.0.10 and 3.1.0

@samlown
Copy link
Member

samlown commented Sep 6, 2011

Hi, that is very annoying. Looks like we're missing some test coverage. If you feel like adding a test-case that would save us some time and help us get round to it sooner. I suspect the fix would be to disable the changed? check if mass_assign_any_attribute is enabled.

Cheers, sam

@ecuageo
Copy link

ecuageo commented Nov 2, 2011

I ran into this also. Is anyone looking to work on this or should I submit a patch?

@jonathanhall
Copy link
Contributor Author

I didn't know how to link it up to this on github, but I stuck this up #116
It was a little while ago now, so you might want to confirm it works

@metakeule
Copy link

a workaround:

class Person < CouchRest::Model::Base
    mass_assign_any_attribute true
    property :is_updated

    before_validation do
      is_updated_will_change!
    end
end

@pentagon
Copy link

pentagon commented Nov 1, 2012

is there any pull request to address this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants