Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a check to ensure created_at and updated_at are Time (#454)
If a column is named `created_at` or `updated_at` is not a type `Time?`, then the following occurs: ```There was a problem expanding macro 'macro_4801706624' Code in lib/granite/src/granite/transactions.cr:82:5 82 | {% if @type.instance_vars.select { |ivar| ivar.annotation(Granite::Column) }.map(&.name.stringify).includes? "created_at" %} ^ Called macro defined in lib/granite/src/granite/transactions.cr:82:5 82 | {% if @type.instance_vars.select { |ivar| ivar.annotation(Granite::Column) }.map(&.name.stringify).includes? "created_at" %} Which expanded to: > 1 | > 2 | if mode == :create > 3 | @created_at = time.at_beginning_of_second ^--------------------- ``` this simply adds a type check.
- Loading branch information