Skip to content

Commit

Permalink
Increase maximum length for participatory text title (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi authored Feb 9, 2024
1 parent 1f617e6 commit c9abbf2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

module Decidim
module Proposals
module Admin
# A form object to be used when admin users want to create a proposal
# through the participatory texts.
class ParticipatoryTextProposalForm < Admin::ProposalBaseForm
attribute :title, String
attribute :body, String
validates :title, length: { maximum: 200 }, presence: true

def map_model(model)
self.title = translated_attribute(model.title)
self.body = translated_attribute(model.body)
end
end
end
end
end
1 change: 1 addition & 0 deletions spec/lib/overrides_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
files: {
"/app/cells/decidim/proposals/participatory_text_proposal/buttons.erb" => "0810f2a8eebf476b67632227a5c73ff2",
"/app/cells/decidim/proposals/participatory_text_proposal/show.erb" => "a6fd0029e01e712314f555a9397485f8",
"/app/forms/decidim/proposals/admin/participatory_text_proposal_form.rb" => "00d3e80982cc65d51c0fd9a85445526d",
"/app/views/decidim/proposals/proposals/participatory_texts/_index.html.erb" => "6d3666c3c116689bae657da537d9deef"
}
}
Expand Down

0 comments on commit c9abbf2

Please sign in to comment.