Skip to content

Commit

Permalink
Remove unnecesary present? and blank? checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dbwinger committed Apr 11, 2022
1 parent e7e79e6 commit 8de92d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/views/alchemy/admin/elements/_element.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
<!-- Ingredients -->
<% if element.has_ingredients_defined? %>
<div class="element-ingredient-editors">
<%= render element.ingredients.select { |i| i.definition[:group].blank? }, element_form: f %>
<%= render element.ingredients.select { |i| i.definition[:group] }, element_form: f %>

<!-- Each ingredient group -->
<% element.ingredients.select { |i| i.definition[:group].present? }.group_by { |i| i.definition[:group] }.each do |group, ingredients| %>
<% element.ingredients.select { |i| i.definition[:group] }.group_by { |i| i.definition[:group] }.each do |group, ingredients| %>
<div class="content-group">
<%= link_to '#', id: "content_group_#{group.parameterize.underscore}_header", class: 'content-group-header', data: { toggle_content_group: true } do %>
<i class="content-group-expand icon fa-fw fa-plus fas"></i>
Expand All @@ -45,10 +45,10 @@
<% end %>
<!-- Contents -->
<div id="element_<%= element.id %>_content" class="element-content-editors">
<%= render element.contents.select { |c| c.definition[:group].blank? } %>
<%= render element.contents.select { |c| c.definition[:group] } %>

<!-- Each content group -->
<% element.contents.select { |c| c.definition[:group].present? }.group_by { |c| c.definition[:group] }.each do |group, contents| %>
<% element.contents.select { |c| c.definition[:group] }.group_by { |c| c.definition[:group] }.each do |group, contents| %>
<div class="content-group">
<%= link_to '#', id: "content_group_#{group.parameterize.underscore}_header", class: 'content-group-header', data: { toggle_content_group: true } do %>
<i class="content-group-expand icon fa-fw fa-plus fas"></i>
Expand Down

0 comments on commit 8de92d8

Please sign in to comment.