Module: ROM::Model::Attributes
- Defined in:
- lib/rom/model/attributes.rb
Overview
Mixin for validatable and coercible parameters
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- VirtusModel =
Virtus.model(nullify_blank: true)
Class Method Summary collapse
-
.included(base) ⇒ Object
private
Inclusion hook used to extend a class with required interfaces.
Instance Method Summary collapse
-
#model_name ⇒ ActiveModel::Name
Return model name for the attributes class.
Class Method Details
.included(base) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Inclusion hook used to extend a class with required interfaces
34 35 36 37 38 39 40 |
# File 'lib/rom/model/attributes.rb', line 34 def self.included(base) base.class_eval do include VirtusModel include ActiveModel::Conversion end base.extend(ClassMethods) end |
Instance Method Details
#model_name ⇒ ActiveModel::Name
Return model name for the attributes class
The model name object is configurable using ‘set_model_name` macro
51 52 53 |
# File 'lib/rom/model/attributes.rb', line 51 def model_name self.class.model_name end |