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

Using the generic name T in an operation name will case after_save to fail silently #836

Open
wout opened this issue Apr 16, 2022 · 0 comments · May be fixed by #859
Open

Using the generic name T in an operation name will case after_save to fail silently #836

wout opened this issue Apr 16, 2022 · 0 comments · May be fixed by #859

Comments

@wout
Copy link
Contributor

wout commented Apr 16, 2022

The T generic silently clashes with the one used in after_save.

So this does not work:

class SaveSomeModel(T) < SomeModel::SaveOperation
  after_save do |some_model|
    # use T...
  end
end

But this does:

class SaveSomeModel(Some) < SomeModel::SaveOperation
  after_save do |some_model|
    # use Some...
  end
end

As proposed in the Discord, it would be better not never use T inside the framework, but use something like LuckyT instead.

jwoertink added a commit that referenced this issue Jul 20, 2022
@jwoertink jwoertink linked a pull request Jul 20, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant