Rename image_description column to image_title on budget investments.

This commit is contained in:
Senén Rodero Rodríguez
2017-06-20 13:28:50 +02:00
parent 673fc66011
commit 515d6d7e70
12 changed files with 24 additions and 19 deletions

View File

@@ -42,8 +42,8 @@ class Budget
validates :description, length: { maximum: Budget::Investment.description_max_length }
validates :terms_of_service, acceptance: { allow_nil: false }, on: :create
validates_attachment :image, content_type: { content_type: ["image/jpeg"] }
validates :image_description, presence: true, if: -> { image.present? }
validates :image_description, length: { in: 4..Budget::Investment.title_max_length }, if: -> { image.present? }
validates :image_title, presence: true, if: -> { image.present? }
validates :image_title, length: { in: 4..Budget::Investment.title_max_length }, if: -> { image.present? }
scope :sort_by_confidence_score, -> { reorder(confidence_score: :desc, id: :desc) }
scope :sort_by_ballots, -> { reorder(ballot_lines_count: :desc, id: :desc) }