investment can not have many headings
This commit is contained in:
committed by
Juanjo Bazán
parent
183034abb4
commit
da769d8746
@@ -21,4 +21,3 @@ class Budget < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ class Budget
|
|||||||
belongs_to :budget
|
belongs_to :budget
|
||||||
belongs_to :geozone
|
belongs_to :geozone
|
||||||
|
|
||||||
|
has_many :investments
|
||||||
|
|
||||||
validates :budget_id, presence: true
|
validates :budget_id, presence: true
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
validates :price, presence: true
|
validates :price, presence: true
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ class Budget
|
|||||||
has_many :valuation_assignments, dependent: :destroy
|
has_many :valuation_assignments, dependent: :destroy
|
||||||
has_many :valuators, through: :valuation_assignments
|
has_many :valuators, through: :valuation_assignments
|
||||||
has_many :comments, as: :commentable
|
has_many :comments, as: :commentable
|
||||||
has_many :headings, dependent: :destroy
|
|
||||||
|
|
||||||
validates :title, presence: true
|
validates :title, presence: true
|
||||||
validates :author, presence: true
|
validates :author, presence: true
|
||||||
|
|||||||
Reference in New Issue
Block a user