diff --git a/app/controllers/admin/base_items_controller.rb b/app/controllers/admin/base_items_controller.rb index 9208e3c345..90d37f0a0e 100644 --- a/app/controllers/admin/base_items_controller.rb +++ b/app/controllers/admin/base_items_controller.rb @@ -40,7 +40,7 @@ def show def destroy @base_item = BaseItem.includes(:items).find(params[:id]) - if !@base_item.items.empty? && @base_item.destroy + if @base_item.items.any? && @base_item.destroy redirect_to admin_base_items_path, notice: "Base Item deleted!" else redirect_to admin_base_items_path, alert: "Failed to delete Base Item. Are there still items attached?" diff --git a/app/services/distribution_content_change_service.rb b/app/services/distribution_content_change_service.rb index edea4715b1..1ff2a322c4 100644 --- a/app/services/distribution_content_change_service.rb +++ b/app/services/distribution_content_change_service.rb @@ -14,7 +14,7 @@ def call end def any_change? - !updates.empty? || !removed.empty? + updates.any? || removed.any? end def changes diff --git a/app/services/sync_ndbn_members.rb b/app/services/sync_ndbn_members.rb index 1e2b247da2..520bc65298 100644 --- a/app/services/sync_ndbn_members.rb +++ b/app/services/sync_ndbn_members.rb @@ -19,7 +19,7 @@ def sync next elsif ndbn_member.persisted? && ndbn_member.changed? Rails.logger.info("#{ndbn_member.id} changed their account name from #{ndbn_member.account_name_was} to #{ndbn_member.account_name}.") - elsif !ndbn_member.persisted? + elsif ndbn_member.new_record? Rails.logger.info("New record found! #{ndbn_member.id} - #{ndbn_member.account_name} has been added!") end diff --git a/app/views/distribution_mailer/_distribution_changes.html.erb b/app/views/distribution_mailer/_distribution_changes.html.erb index 5d5be55ab7..948aaddaf0 100644 --- a/app/views/distribution_mailer/_distribution_changes.html.erb +++ b/app/views/distribution_mailer/_distribution_changes.html.erb @@ -1,6 +1,6 @@

Here are some Items that we need change based on Human Essentials