-
Notifications
You must be signed in to change notification settings - Fork 77
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
Upsert should update created_at/updated_at when using activerecord. #33
Comments
Is there any movement on this bug? It'd be nice to rely on upsert creating/updating created_at and updated_at fields where appropriate. |
hi @sshack not from me - @raviolicode or @pnomolos do you have any time? |
I don't for this, still need to take a look at #31 and work's been way too busy these last couple weeks. I do foresee the problem with this one being that |
@pnomolos We could add this feature, but I'm not sure if we should try to support timestamps like ActiveRecord does. @seamusabshere agrees with this. What I think we should do though, is to treat |
right, my feeling is that we should remove the current support for |
hey @raviolicode want to rip out current special treatment for |
rip out support entirely or make it optional? On Apr 18, 2014, at 2:16 PM, Seamus Abshere [email protected] wrote:
|
@sshack would you be willing to contribute code that provides an option like |
Seamus, Cheers On Apr 21, 2014, at 6:20 AM, Seamus Abshere [email protected] wrote:
|
So I took a look at this this weekend. I'm limiting my changes to the rails helper code path. That makes the most sense to me. Suggestions here, or do I go spelunking? As a side issue, upsert steps out of rails magic-land. Which means I lose rails' data model validations/error handling, is there a way to get this behaviour back? |
hi @sshack Maybe a better option name would be (and re: Rails magic, it's by design that we're not tied to ActiveRecord! We just use whatever database connection we can find.) |
Could I recommend something a little more generic than |
that's awesome to know @pnomolos - suddenly I feel better about this existing at all. so assuming we use a more generic option name, do we want to
should we support both, with different option names? |
… record. But the upsert gem doesn't update timestamps (seamusabshere/upsert#33)
Was this ever resolved? Or is it still up in the air? I just ran into this with "created_at" staying null... |
@fatcatt316 this is still up in the air, unfortunately |
@seamusabshere Thanks for the quick reply. I'm pondering ways around it, although for me it's not a showstopper... |
How about |
Since this merge #15 upsert
no longer updates (or creates) updated_at created_at columns.
To play well with existing rails apps this behaviour should be optional.
The text was updated successfully, but these errors were encountered: