Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev committed Feb 14, 2025
1 parent a866961 commit 3f7fecf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/dummy/app/avo/resources/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Avo::Resources::Product < Avo::BaseResource
self.discreet_information = [
{
tooltip: -> { sanitize("Product is <strong>#{record.status}</strong>", tags: %w[strong]) },
icon: "heroicons/outline/bold"
icon: -> { "heroicons/outline/#{record.status == :new ? "arrow-up-right" : "arrow-down-right"}" }
},
:timestamps
]
Expand Down
4 changes: 3 additions & 1 deletion spec/dummy/app/models/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3f7fecf

Please sign in to comment.