einzige / sneaky-save

Allows to update complex objects without triggering validations or callbacks.
45 stars 30 forks source link

Adds #sneaky_save! #6

Closed akshayrawat closed 9 years ago

akshayrawat commented 9 years ago

@einzige Let me know what you think.

akshayrawat commented 9 years ago

@einzige Hound seems to have commented a bunch. Not sure if it got into this repo from my account or yours.

einzige commented 9 years ago

@akshayrawat sounds reasonable, thanks. Let's apply some updates to this PR and I will merge.

akshayrawat commented 9 years ago

@einzige Let me know if there is anything else, and I'll squash all commits into one.

einzige commented 9 years ago

@akshayrawat let's remove #sneaky_create_or_update and you can squash your commits.

akshayrawat commented 9 years ago

@einzige The #sneaky_create_or_update method was added to mimic ActiveRecord's #create_or_update. With that sneaky-save's interface become's similar to AR's but with the sneaky_ prefix.

Let me know what you think. Or else I'll just get rid of it.

akshayrawat commented 9 years ago

Also perhaps just as food for thought – Maybe this can also be done as of one of those ActiveModel Concern type of things which gets included into the models which need sneaky saving.

Anyways, we'll see later, its simple as it is ;)

akshayrawat commented 9 years ago

@einzige Added its usage to the docs.

einzige commented 9 years ago

@einzige The #sneaky_create_or_update method was added to mimic ActiveRecord's #create_orupdate. With that sneaky-save's interface become's similar to AR's but with the sneaky prefix.

Not a big issue anyway. I am ok with any solution here, just not sure about needs of making it similar to AR.

:+1: Everything looks good, just tested on live app, please squash and i will merge.

akshayrawat commented 9 years ago

Done!

akshayrawat commented 9 years ago

:shipit: