Skip to content

Commit

Permalink
fix: don't fetch fields on action's initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Jul 29, 2024
1 parent fb235fd commit 7c1b1f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/controllers/avo/actions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def show
@view = Avo::ViewInquirer.new("new")

@resource.hydrate(record: @record, view: @view, user: _current_user, params: params)

# Fetch action's fields
@action.fields
@fields = @action.get_fields

build_background_url
Expand Down
1 change: 0 additions & 1 deletion lib/avo/base_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def initialize(record: nil, resource: nil, user: nil, view: nil, arguments: {},
self.class.cancel_button_label ||= I18n.t("avo.cancel")

self.items_holder = Avo::Resources::Items::Holder.new
fields

@response ||= {}
@response[:messages] = []
Expand Down

0 comments on commit 7c1b1f0

Please sign in to comment.