-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
fix: action visibility on show controls #1833
Conversation
Code Climate has analyzed commit 9e9e2b5 and detected 0 issues on this pull request. View more on Code Climate. |
lib/avo/resources/controls/action.rb
Outdated
def initialize(klass, record: nil, resource: nil, view: nil, **args) | ||
super(**args) | ||
|
||
@klass = klass | ||
@resource = resource | ||
@model = model | ||
@record = record | ||
@view = view | ||
end | ||
|
||
def action | ||
@instance ||= @klass.new(model: @model, resource: @resource, view: @view) | ||
@instance ||= @klass.new(model: @record, resource: @resource, view: @view) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason this class is initialized by Avo::Resources::Controls::Action.new(klass, record: record, resource: resource, view: view, **args)
but the initialize
method was not expecting the same argument name, using model
instead record
. (In avo3 this is already uniformed)
Can we add some tests please? |
This PR has been merged into Please check the release guide for more information. |
Description
Fixes #1769
Action visibility block runs even on show controls actions now
Checklist:
Manual review steps
Manual reviewer: please leave a comment with output from the test if that's the case.