X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/15b104f4ff4614aa78c01180b6a9b89dd5a1400f..091e0c21efd3f4117fc6491a1b25c4d1cbc5a099:/app/models/redaction.rb diff --git a/app/models/redaction.rb b/app/models/redaction.rb index b835864db..5e9e0decd 100644 --- a/app/models/redaction.rb +++ b/app/models/redaction.rb @@ -3,11 +3,11 @@ # Table name: redactions # # id :integer not null, primary key -# title :string -# description :text +# title :string not null +# description :text not null # created_at :datetime # updated_at :datetime -# user_id :integer not null +# user_id :bigint(8) not null # description_format :enum default("markdown"), not null # # Foreign Keys @@ -24,14 +24,15 @@ # record's title and description fields, which can be # displayed linked from the redacted records. # -class Redaction < ActiveRecord::Base +class Redaction < ApplicationRecord belongs_to :user has_many :old_nodes has_many :old_ways has_many :old_relations - validates :description, :presence => true + validates :title, :presence => true, :characters => true + validates :description, :presence => true, :characters => true validates :description_format, :inclusion => { :in => %w[text html markdown] } # this method overrides the AR default to provide the rich