Remove question and external_url fields from legislation proposals

This commit is contained in:
decabeza
2019-03-14 14:06:58 +01:00
parent 0995480b73
commit 5bdac5c4f5
6 changed files with 7 additions and 16 deletions

View File

@@ -53,7 +53,7 @@ class Legislation::ProposalsController < Legislation::BaseController
def proposal_params def proposal_params
params.require(:legislation_proposal).permit(:legislation_process_id, :title, params.require(:legislation_proposal).permit(:legislation_process_id, :title,
:question, :summary, :description, :video_url, :tag_list, :summary, :description, :video_url, :tag_list,
:terms_of_service, :geozone_id, :terms_of_service, :geozone_id,
image_attributes: image_attributes, image_attributes: image_attributes,
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id]) documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id])

View File

@@ -60,7 +60,6 @@ class Legislation::Proposal < ApplicationRecord
def searchable_values def searchable_values
{ title => "A", { title => "A",
question => "B",
author.username => "B", author.username => "B",
tag_list.join(" ") => "B", tag_list.join(" ") => "B",
geozone.try(:name) => "B", geozone.try(:name) => "B",

View File

@@ -59,16 +59,6 @@
<%= safe_html_with_links @proposal.description %> <%= safe_html_with_links @proposal.description %>
<% if @proposal.external_url.present? %>
<div class="document-link">
<p>
<span class="icon-document"></span>&nbsp;
<strong><%= t("proposals.show.title_external_url") %></strong>
</p>
<%= text_with_links @proposal.external_url %>
</div>
<% end %>
<% if @proposal.video_url.present? %> <% if @proposal.video_url.present? %>
<div class="video-link"> <div class="video-link">
<p> <p>
@@ -80,8 +70,6 @@
<% end %> <% end %>
<h4><%= @proposal.question %></h4>
<% if feature?(:allow_attached_documents) %> <% if feature?(:allow_attached_documents) %>
<%= render "documents/documents", <%= render "documents/documents",
documents: @proposal.documents, documents: @proposal.documents,

View File

@@ -2,7 +2,6 @@ section "Creating legislation proposals" do
10.times do 10.times do
Legislation::Proposal.create!(title: Faker::Lorem.sentence(3).truncate(60), Legislation::Proposal.create!(title: Faker::Lorem.sentence(3).truncate(60),
description: Faker::Lorem.paragraphs.join("\n\n"), description: Faker::Lorem.paragraphs.join("\n\n"),
question: Faker::Lorem.sentence(3),
summary: Faker::Lorem.paragraph, summary: Faker::Lorem.paragraph,
author: User.all.sample, author: User.all.sample,
process: Legislation::Process.all.sample, process: Legislation::Process.all.sample,

View File

@@ -0,0 +1,6 @@
class RemoveQuestionAndExternalUrlFromLegislationProposals < ActiveRecord::Migration
def change
remove_column :legislation_proposals, :question, :string
remove_column :legislation_proposals, :external_url, :string
end
end

View File

@@ -727,7 +727,6 @@ ActiveRecord::Schema.define(version: 20190411090023) do
t.integer "legislation_process_id" t.integer "legislation_process_id"
t.string "title", limit: 80 t.string "title", limit: 80
t.text "description" t.text "description"
t.string "question"
t.integer "author_id" t.integer "author_id"
t.datetime "hidden_at" t.datetime "hidden_at"
t.integer "flags_count", default: 0 t.integer "flags_count", default: 0