Class: CategoryRisk
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- CategoryRisk
- Defined in:
- app/models/category_risk.rb
Overview
Instance Attribute Summary collapse
-
#category_id ⇒ Integer
Reference id to Category.
-
#created_at ⇒ Datetime
Date when the record was created.
-
#id ⇒ Integer
Is the unique identifier for CategoryRisk.
-
#risk_id ⇒ Integer
Reference id to Risk.
-
#updated_at ⇒ Datetime
Date when the record was updated.
Instance Method Summary collapse
-
#category ⇒ Object
Instance of referenced Category.
-
#risk ⇒ Object
Instance of referenced Risk.
Methods inherited from ApplicationRecord
Instance Attribute Details
#category_id ⇒ Integer
Returns reference id to Category.
27 28 29 30 31 32 |
# File 'app/models/category_risk.rb', line 27 class CategoryRisk < ApplicationRecord belongs_to :category belongs_to :risk validates :category, uniqueness: { scope: :risk } end |
#created_at ⇒ Datetime
Returns date when the record was created.
27 28 29 30 31 32 |
# File 'app/models/category_risk.rb', line 27 class CategoryRisk < ApplicationRecord belongs_to :category belongs_to :risk validates :category, uniqueness: { scope: :risk } end |
#id ⇒ Integer
Returns is the unique identifier for CategoryRisk.
27 28 29 30 31 32 |
# File 'app/models/category_risk.rb', line 27 class CategoryRisk < ApplicationRecord belongs_to :category belongs_to :risk validates :category, uniqueness: { scope: :risk } end |
#risk_id ⇒ Integer
Returns reference id to Risk.
27 28 29 30 31 32 |
# File 'app/models/category_risk.rb', line 27 class CategoryRisk < ApplicationRecord belongs_to :category belongs_to :risk validates :category, uniqueness: { scope: :risk } end |
#updated_at ⇒ Datetime
Returns date when the record was updated.
27 28 29 30 31 32 |
# File 'app/models/category_risk.rb', line 27 class CategoryRisk < ApplicationRecord belongs_to :category belongs_to :risk validates :category, uniqueness: { scope: :risk } end |
Instance Method Details
#category ⇒ Object
Returns instance of referenced Category.
27 28 29 30 31 32 |
# File 'app/models/category_risk.rb', line 27 class CategoryRisk < ApplicationRecord belongs_to :category belongs_to :risk validates :category, uniqueness: { scope: :risk } end |
#risk ⇒ Object
Returns instance of referenced Risk.
27 28 29 30 31 32 |
# File 'app/models/category_risk.rb', line 27 class CategoryRisk < ApplicationRecord belongs_to :category belongs_to :risk validates :category, uniqueness: { scope: :risk } end |