Chore: Remove deprecation warning post rails upgrade (#7080)
Fixes: https://linear.app/chatwoot/issue/CW-1575/fix-deprecations-post-upgrade-to-rails-7
This commit is contained in:
@@ -45,8 +45,8 @@ to display a collection of resources in an HTML table.
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<% [valid_action?(:edit, collection_presenter.resource_name),
|
||||
valid_action?(:destroy, collection_presenter.resource_name)].count(true).times do %>
|
||||
<% [existing_action?(collection_presenter.resource_name, :edit),
|
||||
existing_action?(collection_presenter.resource_name, :destroy)].count(true).times do %>
|
||||
<th scope="col"></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
@@ -56,13 +56,13 @@ to display a collection of resources in an HTML table.
|
||||
<% resources.each do |resource| %>
|
||||
<tr class="js-table-row"
|
||||
tabindex="0"
|
||||
<% if valid_action? :show, collection_presenter.resource_name %>
|
||||
<% if existing_action? collection_presenter.resource_name, :show %>
|
||||
<%= %(role=link data-url=#{polymorphic_path([namespace, resource])}) %>
|
||||
<% end %>
|
||||
>
|
||||
<% collection_presenter.attributes_for(resource).each do |attribute| %>
|
||||
<td class="cell-data cell-data--<%= attribute.html_class %>">
|
||||
<% if show_action? :show, resource -%>
|
||||
<% if authorized_action? resource, :show -%>
|
||||
<a href="<%= polymorphic_path([namespace, resource]) -%>"
|
||||
class="action-show"
|
||||
>
|
||||
@@ -72,22 +72,22 @@ to display a collection of resources in an HTML table.
|
||||
</td>
|
||||
<% end %>
|
||||
|
||||
<% if valid_action? :edit, collection_presenter.resource_name %>
|
||||
<% if existing_action? collection_presenter.resource_name, :edit %>
|
||||
<td><%= link_to(
|
||||
t("administrate.actions.edit"),
|
||||
[:edit, namespace, resource],
|
||||
class: "action-edit",
|
||||
) if show_action? :edit, resource%></td>
|
||||
) if authorized_action? resource, :edit%></td>
|
||||
<% end %>
|
||||
|
||||
<% if valid_action? :destroy, collection_presenter.resource_name %>
|
||||
<% if existing_action? collection_presenter.resource_name, :destroy %>
|
||||
<td><%= link_to(
|
||||
t("administrate.actions.destroy"),
|
||||
[namespace, resource],
|
||||
class: "text-color-red",
|
||||
method: :delete,
|
||||
data: { confirm: t("administrate.actions.confirm") }
|
||||
) if show_action? :destroy, resource %></td>
|
||||
) if authorized_action? resource, :destroy %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -46,7 +46,7 @@ as defined by the routes in the `admin/` namespace
|
||||
<%= link_to(
|
||||
display_resource_name(resource),
|
||||
resource_index_route(resource)
|
||||
) if valid_action? :index, resource %>
|
||||
) if existing_action? resource, :index %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ It renders the `_table` partial to display details about the resources.
|
||||
),
|
||||
[:new, namespace, page.resource_path.to_sym],
|
||||
class: "button",
|
||||
) if valid_action?(:new) && show_action?(:new, new_resource) %>
|
||||
) if accessible_action?(new_resource, :new) %>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user