On Sunday, March 2, 2014 4:16:15 AM UTC-8, Roland Groza wrote:
>
> I have been trying sequel for the past few days and I'm trying to set up 
> the :timestamps plugin to add a created_at and updated_at to my tables 
> whenever a new record is created or updated (the columns exist obviously in 
> the table). This would be my migration:
>
> 02_example.rb
>
> Sequel.migration do
>>   change do
>>     add_column :users, :created_at, DateTime
>>     add_column :users, :updated_at, DateTime
>>   end
>> end
>
>
> And I have the following config.ru
>
> Sequel::Model.plugin :timestamps, :create => :created_on, :update => 
>> :updated_on, :update_on_create => true
>>
>
It helps if you use the same column names. :)

Assuming your migrations are correct, you probably want:
 
  Sequel::Model.plugin :timestamps, :update_on_create => true

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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to