Class: MOCO::ProjectGroup
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- MOCO::ProjectGroup
- Defined in:
- lib/moco/entities/project_group.rb
Overview
Represents a MOCO project group for organizing projects
Required attributes for create:
name - String, group name
Read-only attributes:
id, created_at, updated_at
Example:
# Create a project group
moco.project_groups.create(name: "Website Projects")
# Get projects in a group
group = moco.project_groups.find(123)
group.projects # => Array of Project objects
Note:
To assign a project to a group, set project_group_id when
creating/updating the project.
Instance Attribute Summary
Attributes inherited from BaseEntity
Class Method Summary collapse
Instance Method Summary collapse
-
#projects ⇒ Object
Get projects in this group.
- #to_s ⇒ Object
Methods inherited from BaseEntity
#==, #association, #destroy, #eql?, #has_many, #hash, #id, #initialize, #inspect, #reload, #save, #to_h, #to_json, #update
Constructor Details
This class inherits a constructor from MOCO::BaseEntity
Class Method Details
.entity_path ⇒ Object
25 26 27 |
# File 'lib/moco/entities/project_group.rb', line 25 def self.entity_path "projects/groups" end |
Instance Method Details
#projects ⇒ Object
Get projects in this group
30 31 32 |
# File 'lib/moco/entities/project_group.rb', line 30 def projects has_many(:projects, :project_group_id) end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/moco/entities/project_group.rb', line 34 def to_s name.to_s end |