Class: ProjectReport
- Inherits:
-
Domain::Model
- Object
- Domain::Model
- ProjectReport
- Defined in:
- lib/domain/project/model.rb
Instance Attribute Summary collapse
-
#created_by_first_name ⇒ Object
Returns the value of attribute created_by_first_name.
-
#created_by_last_name ⇒ Object
Returns the value of attribute created_by_last_name.
-
#created_on ⇒ Object
Returns the value of attribute created_on.
-
#description ⇒ Object
Returns the value of attribute description.
-
#file_name ⇒ Object
Returns the value of attribute file_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ ProjectReport
constructor
A new instance of ProjectReport.
Methods inherited from Domain::Model
columns, from_csv, from_json, headers, table_name, #to_csv, #to_hash, #to_s, view
Constructor Details
#initialize(attributes = {}) ⇒ ProjectReport
Returns a new instance of ProjectReport.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/domain/project/model.rb', line 31 def initialize(attributes = {}) remapped_attributes = attributes.transform_keys do |key| case key when 'report_id' then 'id' when 'report_name' then 'name' when 'report_description' then 'description' when 'report_filename' then 'file_name' when 'report_status' then 'status' when 'created_date' then 'created_on' when 'created_user_firstname' then 'created_by_first_name' when 'created_user_lastname' then 'created_by_last_name' else key # For all other keys that do not need remapping end end super(remapped_attributes) # Call the superclass's initialize method end |
Instance Attribute Details
#created_by_first_name ⇒ Object
Returns the value of attribute created_by_first_name.
28 29 30 |
# File 'lib/domain/project/model.rb', line 28 def created_by_first_name @created_by_first_name end |
#created_by_last_name ⇒ Object
Returns the value of attribute created_by_last_name.
28 29 30 |
# File 'lib/domain/project/model.rb', line 28 def created_by_last_name @created_by_last_name end |
#created_on ⇒ Object
Returns the value of attribute created_on.
28 29 30 |
# File 'lib/domain/project/model.rb', line 28 def created_on @created_on end |
#description ⇒ Object
Returns the value of attribute description.
28 29 30 |
# File 'lib/domain/project/model.rb', line 28 def description @description end |
#file_name ⇒ Object
Returns the value of attribute file_name.
28 29 30 |
# File 'lib/domain/project/model.rb', line 28 def file_name @file_name end |
#id ⇒ Object
Returns the value of attribute id.
28 29 30 |
# File 'lib/domain/project/model.rb', line 28 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
28 29 30 |
# File 'lib/domain/project/model.rb', line 28 def name @name end |
#project_id ⇒ Object
Returns the value of attribute project_id.
28 29 30 |
# File 'lib/domain/project/model.rb', line 28 def project_id @project_id end |
#status ⇒ Object
Returns the value of attribute status.
28 29 30 |
# File 'lib/domain/project/model.rb', line 28 def status @status end |
Class Method Details
.primary_key ⇒ Object
48 49 50 |
# File 'lib/domain/project/model.rb', line 48 def self.primary_key %w[id project_id] end |
.url_path(id) ⇒ Object
52 53 54 |
# File 'lib/domain/project/model.rb', line 52 def self.url_path(id) "/projects/#{id}/reports" end |