Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including the DatabaseValidations in Avram::Operation causes compile error #1014

Open
jwoertink opened this issue Mar 19, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@jwoertink
Copy link
Member

jwoertink commented Mar 19, 2024

When you include the Avram::DatabaseValidations mixin in to any Avram::Operation, there's no record methods, so this line falls back to thinking record is Crystal's macro record.

record.try(&.id).try do |id|

Then you'll get a "wrong number of arguments for macro record" error. This is misleading though.

We can either rename record in the SaveOperation (which would be a breaking change)

property record : T?

Or we can include an empty record method in the operation

private def record
  # do nothing
end
@jwoertink jwoertink added the bug Something isn't working label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant