Class: TagGroup::FormObject
- Inherits:
-
Object
- Object
- TagGroup::FormObject
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/tag_group/form_object.rb
Overview
This form object class handles the user interaction for creating new Tag Groups. It sensibility checks the user-entered list of Tag oligo sequences before creating the Tag Group and Tags.
Instance Attribute Summary collapse
-
#adapter_type_id ⇒ Object
Attributes.
-
#name ⇒ Object
Attributes.
-
#oligos_text ⇒ Object
Attributes.
-
#tag_group ⇒ Object
readonly
Access the tag group record after it’s saved.
Class Method Summary collapse
-
.model_name ⇒ Object
form builder methods (e.g. form_to) need the Active Model name to be set.
Instance Method Summary collapse
Instance Attribute Details
#adapter_type_id ⇒ Object
Attributes
11 12 13 |
# File 'app/models/tag_group/form_object.rb', line 11 def adapter_type_id @adapter_type_id end |
#name ⇒ Object
Attributes
11 12 13 |
# File 'app/models/tag_group/form_object.rb', line 11 def name @name end |
#oligos_text ⇒ Object
Attributes
11 12 13 |
# File 'app/models/tag_group/form_object.rb', line 11 def oligos_text @oligos_text end |
#tag_group ⇒ Object (readonly)
Access the tag group record after it’s saved
14 15 16 |
# File 'app/models/tag_group/form_object.rb', line 14 def tag_group @tag_group end |
Class Method Details
.model_name ⇒ Object
form builder methods (e.g. form_to) need the Active Model name to be set
32 33 34 |
# File 'app/models/tag_group/form_object.rb', line 32 def self.model_name ActiveModel::Name.new(TagGroup) end |
Instance Method Details
#save ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'app/models/tag_group/form_object.rb', line 21 def save if valid? persist! true else errors.add(:oligos_text, I18n.t('tag_groups.errors.tag_group_form_invalid')) false end end |