Just curious, I'm wondering if it makes sense to add a flag only when you 
creating a lot of records at once and don't need the refresh?

so like 

Model.plugin :skip_create_refresh, default: false
record = Model.new
record.skip_create_refresh = true
record.save

Otherwise if they don't specify default: false, then it's just the normal 
behavior always.

thoughts?

On Wednesday, July 26, 2017 at 7:49:12 PM UTC-7, Aryk Grosz wrote:
>
> Ah got it, I thought I was going crazy for a second there, I thought I 
> introduced that into my code somehow, lol. - Aryk
>
> On Wednesday, July 26, 2017 at 9:05:57 AM UTC-7, Jeremy Evans wrote:
>>
>> On Wednesday, July 26, 2017 at 12:08:54 AM UTC-7, Aryk Grosz wrote:
>>>
>>> Jeremy, I notice there is a select happening after a call to #create to 
>>> refresh the record (I think). Is that required after inserting to get the 
>>> new values and new primary key? I'm using mysql if that helps.
>>>
>>
>> The select query is used to get the new values (the primary key result 
>> comes from insert's return value).  You can use the skip_create_refresh 
>> plugin if you don't want that behavior.
>>
>> Thanks,
>> Jeremy
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sequel-talk+unsubscr...@googlegroups.com.
To post to this group, send email to sequel-talk@googlegroups.com.
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to