amberframework / amber

A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
https://amberframework.org
MIT License
2.57k stars 205 forks source link

Support for crystal 1.4.0 #1276

Closed backward-crazy-mage-puppy-36 closed 2 years ago

backward-crazy-mage-puppy-36 commented 2 years ago

Creating a new amber app with crystal v 1.4.0 and amber -v 1.2.1 and generating a table for authentication amber g auth User When amber w results in There was a problem expanding macro 'column'

Code in macro 'timestamps'

2 | column updated_at : Time? ^ Called macro defined in lib/granite/src/granite/columns.cr:63:3

63 | macro column(decl, **options)

Which expanded to:

14 | 15 | 16 | @[Granite::Column(column_type: nil, converter: nil, auto: false, primary: false, nilable: true)] ^ Error: can't annotate @updated_at in User because it was first defined in Granite::Base

VanyaNeytrino commented 2 years ago

how to understand what is the cause of the bug? I looked at the sources and it's not clear at all. Does anyone have any thoughts on this?

drujensen-happymoney commented 2 years ago

Looks like you can't annotate @updated_at in User because it was first defined in Granite::Base

Consider removing the updated_at column from the User class since it's already defined in the Base class.

VanyaNeytrino commented 2 years ago

Looks like you can't annotate @updated_at in User because it was first defined in Granite::Base

Consider removing the updated_at column from the User class since it's already defined in the Base class.

Thanks. I commented out the row column update_at : Time? in https://github.com/amberframework/granite/blob/master/src/granite/columns.cr#L108 would such a decision be normal?

crimson-knight commented 2 years ago

This was an issue with Granite, I put up a PR that resolves this. Hopefully, it'll get merged in soon and you'll be good as gold!

robacarp commented 2 years ago

https://github.com/amberframework/granite/pull/465 is merged now. If that fixes the issue please let us know!

crimson-knight commented 2 years ago

@backward-crazy-mage-puppy-36 please run brew upgrade amber to get the latest version, and this issue will be resolved.

If any other issues arise, please create a new issue or join us on discord! :)