Closed akshayrawat closed 9 years ago
@einzige Hound seems to have commented a bunch. Not sure if it got into this repo from my account or yours.
@akshayrawat sounds reasonable, thanks. Let's apply some updates to this PR and I will merge.
@einzige Let me know if there is anything else, and I'll squash all commits into one.
@akshayrawat let's remove #sneaky_create_or_update and you can squash your commits.
@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.
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 ;)
@einzige Added its usage to the docs.
@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.
Done!
:shipit:
ActiveRecord::Base#save!
. Our use-cases always need a whinysneaky_save!
(similar to when you would prefer to usesave!
) as we never expect it to fail. When it does, we want it to complain loudly with the inner exception. Instead of repeating that pattern in our code-base, we've pushed it into this gem.@einzige Let me know what you think.