Further update Granite to be compatible with Crystal 0.25#231
Conversation
|
I have asked in the Crystal channel about |
|
I think we should be using |
|
I’d discourage tagging after this is merged until it’s known that no other changes need to be made to Granite to make amber compatible |
|
To be safe we should probably use |
| end | ||
|
|
||
| def initialize(args : Hash(Symbol | String, String | JSON::Any)) | ||
| def initialize(args : Hash(Symbol | String, JSON::Any::Type)) |
There was a problem hiding this comment.
Lets define a initialize overload, I think it would be better
def initialize(args : Hash(Symbol | String, JSON::Any::Type))
new(JSON::Any.new raw(args))
end
def initialize(args : Hash(Symbol | String, JSON::Any))
end| set_attributes(args) | ||
| end | ||
|
|
||
| def initialize(args : Hash(Symbol | String, Granite::Fields::Type)) |
| stmt << "(" | ||
| stmt << Array.new(fields.size, '?').join(',') | ||
| params.concat fields.map { |field| model.to_h[field] } | ||
| params.concat fields.map { |field| model.read_attribute field } |
There was a problem hiding this comment.
neat, i like that better.
- New libraries handle enforcing UTC internally - UTC in adapters is rounded to the second, so timestamps must be .at_beginning_of_second
b0525a9 to
e48f97f
Compare
|
👍🏻 |
|
Sweet this is now passing |
The latest granite tag produces this when attempting to build amber projects which used the scaffold generator:
In trying to get the amber project compatible with crystal 0.25, I'd like to change this to JSON::Any::Type, which allows the generated code to compile.