Removes geozone from budget heading

This commit is contained in:
kikito
2017-01-03 18:51:21 +01:00
parent 2c343788d5
commit 52d182f099
5 changed files with 12 additions and 11 deletions

View File

@@ -1,7 +1,6 @@
class Budget
class Heading < ActiveRecord::Base
belongs_to :group
belongs_to :geozone
has_many :investments

View File

@@ -26,7 +26,7 @@ class Budget
validates :heading_id, presence: true
validates_presence_of :unfeasibility_explanation, if: :unfeasibility_explanation_required?
validates :title, length: { in: 4 .. Budget::Investment.title_max_length }
validates :title, length: { in: 4..Budget::Investment.title_max_length }
validates :description, length: { maximum: Budget::Investment.description_max_length }
validates :terms_of_service, acceptance: { allow_nil: false }, on: :create
@@ -53,7 +53,7 @@ class Budget
scope :by_tag, -> (tag_name) { tagged_with(tag_name) }
scope :by_valuator, -> (valuator_id) { where("budget_valuator_assignments.valuator_id = ?", valuator_id).joins(:valuator_assignments) }
scope :for_render, -> { includes(heading: :geozone) }
scope :for_render, -> { includes(:heading) }
before_save :calculate_confidence_score
before_validation :set_responsible_name