trailblazer-rails icon indicating copy to clipboard operation
trailblazer-rails copied to clipboard

Trailblazer::Rails::Form breaks Reform::Form.human_attribute_name

Open zavan opened this issue 7 years ago • 0 comments

Since Trailblazer::Rails::Form is a SimpleDelegator, it does not delegates class method calls to the wrapped class, thus breaking Reform::Form.human_attribute_name and probably other delegated class methods.

human_attribute_name is used by simple_form here.

A temporary fix may be reopening Trailblazer::Reform::Rails in an initializer and extending it with ActiveModel::Translation, but it's a hack and a very fragile one:

class Trailblazer::Rails::Form < SimpleDelegator
  extend ::ActiveModel::Translation
end

Related #44

zavan avatar Jun 22 '17 08:06 zavan