Skip to content

Commit

Permalink
Revert unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwr18 committed Sep 18, 2023
1 parent 36342e6 commit 8d3f215
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/components/field/field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

module Field
class Field < ApplicationComponent
def initialize(object:, attr:, value: nil, label: nil, **)
def initialize(object:, attr:, value: nil, **)
super

@object = object
@attr = attr
@value = value
@label = label
end

def call
c('base_field', {
id: id,
label: label_or_default,
label: label,
help: help,
errors: errors,
styles: styles,
Expand All @@ -35,7 +34,7 @@ def input_defaults

private

attr_reader :object, :attr, :label
attr_reader :object, :attr

def id
"#{model_name}[#{attr}]"
Expand All @@ -49,8 +48,8 @@ def value
@value ||= object.send(attr)
end

def label_or_default
label || I18n.t("#{model_name}.form.#{attr}.label")
def label
I18n.t("#{model_name}.form.#{attr}.label")
end

def help
Expand Down

0 comments on commit 8d3f215

Please sign in to comment.