spree / deface

Rails plugin that allows you to customize ERB views in a Rails application without editing the underlying view.
MIT License
520 stars 127 forks source link

Default 'name' attr to caller's filename and line number #164

Closed mroach closed 7 years ago

mroach commented 8 years ago

A well-named override will typically describe what it's doing in the file name itself. Specifying the 'name' parameter in such cases is redundant and can be done automatically by the initializer.

Example:

Given the file app/overrides/remove_h1_from_products_index.rb, the name of the Deface::Override would default to remove_h1_from_products_index_NN where NN is the line number on which the initializer is called.