diff --git a/spec/dummy/app/avo/resources/product.rb b/spec/dummy/app/avo/resources/product.rb index 1913912ac..5b62fccc9 100644 --- a/spec/dummy/app/avo/resources/product.rb +++ b/spec/dummy/app/avo/resources/product.rb @@ -31,7 +31,7 @@ class Avo::Resources::Product < Avo::BaseResource self.discreet_information = [ { tooltip: -> { sanitize("Product is #{record.status}", tags: %w[strong]) }, - icon: "heroicons/outline/bold" + icon: -> { "heroicons/outline/#{record.status == :new ? "arrow-up-right" : "arrow-down-right"}" } }, :timestamps ] diff --git a/spec/dummy/app/models/product.rb b/spec/dummy/app/models/product.rb index 9afca7e86..4d1178c56 100644 --- a/spec/dummy/app/models/product.rb +++ b/spec/dummy/app/models/product.rb @@ -33,6 +33,8 @@ class Product < ApplicationRecord has_many_attached :images def status - (id % 2).zero? ? :new : :updated + return :new if id.nil? + return :new if id.even? + return :updated if id.odd? end end