Module: Frenchy::Veneer::ClassMethods
- Defined in:
- lib/frenchy/veneer.rb
Instance Method Summary collapse
-
#veneer(options = {}) ⇒ Object
Macro to establish a veneer for a given model.
Instance Method Details
#veneer(options = {}) ⇒ Object
Macro to establish a veneer for a given model
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/frenchy/veneer.rb', line 16 def veneer(={}) .symbolize_keys! @model = .delete(:model) || raise(Frenchy::ConfigurationError, "Veneer must specify a model") extend ActiveModel::Naming class_eval do def self.model_name ActiveModel::Name.new(self, nil, @model.to_s.camelize) end end end |