Closed solnic closed 6 years ago
From @alexandru-calinoiu on April 23, 2017 15:37
One easy way to solve it is for the timestamp_column to have default values, but is not complete as one won't be able to configure them from a repo.
Ah, right. I'm sorry I forgot we didn't make timestamps
plugin work with repos yet. This will be addressed in rom 4.0 as we need to improve plugin architecture first.
In order to make this work, we need to enable passing options for command plugins here and then refactor timestamp plugin, so that Timestamp
is a Module
subclass, and accepts options. Then based on these options we can automatically configure a command. I would also say that this plugin should be moved to core, as it is not sql-specific.
@solnic I would love to help with this one
From @alexandru-calinoiu on April 23, 2017 15:36
My repo look like
I expect that calling
Entries.new.create(args)
will add timestamps to my entry, but that is not the case.The
Timestamp
plugin get's applied at runtime when I call create, only thenClassInterface
is extended addingtimestamps
method that can be used to configure the colmuns. Without callingtimestamps
theInstanceMethods
will never be included and thus timestamps never added.Unfortunately my understanding of the plugins is very limited, they look like being targeted mostly to commands, will love some pointers for the right direction.
Copied from original issue: rom-rb/rom-sql#189