diff --git a/app/controllers/spending_proposals_controller.rb b/app/controllers/spending_proposals_controller.rb index e82ad3eef..a07783d3d 100644 --- a/app/controllers/spending_proposals_controller.rb +++ b/app/controllers/spending_proposals_controller.rb @@ -29,7 +29,7 @@ class SpendingProposalsController < ApplicationController private def spending_proposal_params - params.require(:spending_proposal).permit(:title, :description, :external_url, :geozone_id, :terms_of_service, :captcha, :captcha_key) + params.require(:spending_proposal).permit(:title, :description, :external_url, :geozone_id, :association_name, :terms_of_service, :captcha, :captcha_key) end def verify_valuator diff --git a/app/views/spending_proposals/_form.html.erb b/app/views/spending_proposals/_form.html.erb index 4805b1bb4..701452652 100644 --- a/app/views/spending_proposals/_form.html.erb +++ b/app/views/spending_proposals/_form.html.erb @@ -22,6 +22,11 @@ <%= f.select :geozone_id, geozone_select_options, {include_blank: t("geozones.none"), label: false} %> +
+ <%= f.label :association_name, t("spending_proposals.form.association_name") %> + <%= f.text_field :association_name, placeholder: t("spending_proposals.form.association_name"), label: false %> +
+
<% if @spending_proposal.new_record? %> <%= f.label :terms_of_service do %> diff --git a/config/locales/en.yml b/config/locales/en.yml index afb3b47ea..f2758c7cc 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -399,6 +399,7 @@ en: youtube: YouTube spending_proposals: form: + association_name: 'Association' description: Description external_url: Link to additional documentation geozone: Scope of operation diff --git a/config/locales/es.yml b/config/locales/es.yml index 048cde021..bd015d81f 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -400,6 +400,7 @@ es: youtube: YouTube spending_proposals: form: + association_name: 'Asociación' description: Descripción detallada external_url: Enlace a documentación adicional geozone: "Ámbito de actuación" diff --git a/db/migrate/20160220181602_add_association_to_spending_proposals.rb b/db/migrate/20160220181602_add_association_to_spending_proposals.rb new file mode 100644 index 000000000..17ded2bc3 --- /dev/null +++ b/db/migrate/20160220181602_add_association_to_spending_proposals.rb @@ -0,0 +1,5 @@ +class AddAssociationToSpendingProposals < ActiveRecord::Migration + def change + add_column :spending_proposals, :association_name, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index ba977e327..dd3633461 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160219172824) do +ActiveRecord::Schema.define(version: 20160220181602) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -294,14 +294,15 @@ ActiveRecord::Schema.define(version: 20160219172824) do t.text "description" t.integer "author_id" t.string "external_url" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "geozone_id" t.string "resolution" t.float "price" t.boolean "legal" t.boolean "feasible" t.text "explanation" + t.string "association_name" end add_index "spending_proposals", ["author_id"], name: "index_spending_proposals_on_author_id", using: :btree diff --git a/spec/features/spending_proposals_spec.rb b/spec/features/spending_proposals_spec.rb index 6b76b02e0..b981c37aa 100644 --- a/spec/features/spending_proposals_spec.rb +++ b/spec/features/spending_proposals_spec.rb @@ -25,6 +25,7 @@ feature 'Spending proposals' do fill_in 'spending_proposal_title', with: 'Build a skyscraper' fill_in 'spending_proposal_description', with: 'I want to live in a high tower over the clouds' fill_in 'spending_proposal_external_url', with: 'http://http://skyscraperpage.com/' + fill_in 'spending_proposal_association_name', with: 'People of the neighbourhood' fill_in 'spending_proposal_captcha', with: correct_captcha_text select 'All city', from: 'spending_proposal_geozone_id' check 'spending_proposal_terms_of_service'