refactor(champ_label): use ApplicationHelper
This commit is contained in:
parent
b185614c87
commit
0e610179fb
1 changed files with 2 additions and 4 deletions
|
@ -1,4 +1,6 @@
|
||||||
class EditableChamp::ChampLabelContentComponent < ApplicationComponent
|
class EditableChamp::ChampLabelContentComponent < ApplicationComponent
|
||||||
|
include ApplicationHelper
|
||||||
|
|
||||||
def initialize(champ:, seen_at: nil)
|
def initialize(champ:, seen_at: nil)
|
||||||
@champ, @seen_at = champ, seen_at
|
@champ, @seen_at = champ, seen_at
|
||||||
end
|
end
|
||||||
|
@ -12,8 +14,4 @@ class EditableChamp::ChampLabelContentComponent < ApplicationComponent
|
||||||
def highlight?
|
def highlight?
|
||||||
@champ.updated_at.present? && @seen_at&.<(@champ.updated_at)
|
@champ.updated_at.present? && @seen_at&.<(@champ.updated_at)
|
||||||
end
|
end
|
||||||
|
|
||||||
def try_format_datetime(datetime)
|
|
||||||
datetime.present? ? I18n.l(datetime) : ''
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue