Merge pull request #3057 from consul/backport-make-milestones-polymorphic

[Backport] Make milestones polymorphic
This commit is contained in:
Javier Martín
2018-12-05 12:12:04 +01:00
committed by GitHub
87 changed files with 741 additions and 443 deletions

View File

@@ -3,5 +3,5 @@
require File.expand_path('../config/application', __FILE__) require File.expand_path('../config/application', __FILE__)
Rails.application.load_tasks Rails.application.load_tasks if Rake::Task.tasks.empty?
KnapsackPro.load_tasks if defined?(KnapsackPro) KnapsackPro.load_tasks if defined?(KnapsackPro)

View File

@@ -2,19 +2,19 @@ class Admin::BudgetInvestmentMilestonesController < Admin::BaseController
include Translatable include Translatable
before_action :load_budget_investment, only: [:index, :new, :create, :edit, :update, :destroy] before_action :load_budget_investment, only: [:index, :new, :create, :edit, :update, :destroy]
before_action :load_budget_investment_milestone, only: [:edit, :update, :destroy] before_action :load_milestone, only: [:edit, :update, :destroy]
before_action :load_statuses, only: [:index, :new, :create, :edit, :update] before_action :load_statuses, only: [:index, :new, :create, :edit, :update]
def index def index
end end
def new def new
@milestone = Budget::Investment::Milestone.new @milestone = Milestone.new
end end
def create def create
@milestone = Budget::Investment::Milestone.new(milestone_params) @milestone = Milestone.new(milestone_params)
@milestone.investment = @investment @milestone.milestoneable = @investment
if @milestone.save if @milestone.save
redirect_to admin_budget_budget_investment_path(@investment.budget, @investment), redirect_to admin_budget_budget_investment_path(@investment.budget, @investment),
notice: t('admin.milestones.create.notice') notice: t('admin.milestones.create.notice')
@@ -47,22 +47,22 @@ class Admin::BudgetInvestmentMilestonesController < Admin::BaseController
image_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy] image_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]
documents_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy] documents_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]
attributes = [:publication_date, :budget_investment_id, :status_id, attributes = [:publication_date, :budget_investment_id, :status_id,
translation_params(Budget::Investment::Milestone), translation_params(Milestone),
image_attributes: image_attributes, documents_attributes: documents_attributes] image_attributes: image_attributes, documents_attributes: documents_attributes]
params.require(:budget_investment_milestone).permit(*attributes) params.require(:milestone).permit(*attributes)
end end
def load_budget_investment def load_budget_investment
@investment = Budget::Investment.find(params[:budget_investment_id]) @investment = Budget::Investment.find(params[:budget_investment_id])
end end
def load_budget_investment_milestone def load_milestone
@milestone = get_milestone @milestone = get_milestone
end end
def get_milestone def get_milestone
Budget::Investment::Milestone.find(params[:id]) Milestone.find(params[:id])
end end
def resource def resource
@@ -70,7 +70,7 @@ class Admin::BudgetInvestmentMilestonesController < Admin::BaseController
end end
def load_statuses def load_statuses
@statuses = Budget::Investment::Status.all @statuses = Milestone::Status.all
end end
end end

View File

@@ -1,20 +1,20 @@
class Admin::BudgetInvestmentStatusesController < Admin::BaseController class Admin::MilestoneStatusesController < Admin::BaseController
before_action :load_status, only: [:edit, :update, :destroy] before_action :load_status, only: [:edit, :update, :destroy]
def index def index
@statuses = Budget::Investment::Status.all @statuses = Milestone::Status.all
end end
def new def new
@status = Budget::Investment::Status.new @status = Milestone::Status.new
end end
def create def create
@status = Budget::Investment::Status.new(status_params) @status = Milestone::Status.new(status_params)
if @status.save if @status.save
redirect_to admin_budget_investment_statuses_path, redirect_to admin_milestone_statuses_path,
notice: t('admin.statuses.create.notice') notice: t('admin.statuses.create.notice')
else else
render :new render :new
@@ -26,7 +26,7 @@ class Admin::BudgetInvestmentStatusesController < Admin::BaseController
def update def update
if @status.update(status_params) if @status.update(status_params)
redirect_to admin_budget_investment_statuses_path, redirect_to admin_milestone_statuses_path,
notice: t('admin.statuses.update.notice') notice: t('admin.statuses.update.notice')
else else
render :edit render :edit
@@ -35,17 +35,17 @@ class Admin::BudgetInvestmentStatusesController < Admin::BaseController
def destroy def destroy
@status.destroy @status.destroy
redirect_to admin_budget_investment_statuses_path, redirect_to admin_milestone_statuses_path,
notice: t('admin.statuses.delete.notice') notice: t('admin.statuses.delete.notice')
end end
private private
def load_status def load_status
@status = Budget::Investment::Status.find(params[:id]) @status = Milestone::Status.find(params[:id])
end end
def status_params def status_params
params.require(:budget_investment_status).permit([:name, :description]) params.require(:milestone_status).permit([:name, :description])
end end
end end

View File

@@ -6,7 +6,7 @@ module Budgets
def show def show
authorize! :read_executions, @budget authorize! :read_executions, @budget
@statuses = ::Budget::Investment::Status.all @statuses = Milestone::Status.all
if params[:status].present? if params[:status].present?
@investments_by_heading = @budget.investments.winners @investments_by_heading = @budget.investments.winners

View File

@@ -24,6 +24,7 @@ class Budget
include Notifiable include Notifiable
include Filterable include Filterable
include Flaggable include Flaggable
include Milestoneable
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id' belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
belongs_to :heading belongs_to :heading
@@ -40,8 +41,6 @@ class Budget
has_many :comments, -> {where(valuation: false)}, as: :commentable, class_name: 'Comment' has_many :comments, -> {where(valuation: false)}, as: :commentable, class_name: 'Comment'
has_many :valuations, -> {where(valuation: true)}, as: :commentable, class_name: 'Comment' has_many :valuations, -> {where(valuation: true)}, as: :commentable, class_name: 'Comment'
has_many :milestones
validates :title, presence: true validates :title, presence: true
validates :author, presence: true validates :author, presence: true
validates :description, presence: true validates :description, presence: true

View File

@@ -1,35 +0,0 @@
class Budget
class Investment
class Milestone < ActiveRecord::Base
include Imageable
include Documentable
documentable max_documents_allowed: 3,
max_file_size: 3.megabytes,
accepted_content_types: [ "application/pdf" ]
translates :title, :description, touch: true
include Globalizable
belongs_to :investment
belongs_to :status, class_name: 'Budget::Investment::Status'
validates :investment, presence: true
validates :publication_date, presence: true
validate :description_or_status_present?
scope :order_by_publication_date, -> { order(publication_date: :asc, created_at: :asc) }
scope :published, -> { where("publication_date <= ?", Date.current) }
scope :with_status, -> { where("status_id IS NOT NULL") }
def self.title_max_length
80
end
def description_or_status_present?
unless description.present? || status_id.present?
errors.add(:description)
end
end
end
end
end

View File

@@ -0,0 +1,7 @@
module Milestoneable
extend ActiveSupport::Concern
included do
has_many :milestones, as: :milestoneable, dependent: :destroy
end
end

31
app/models/milestone.rb Normal file
View File

@@ -0,0 +1,31 @@
class Milestone < ActiveRecord::Base
include Imageable
include Documentable
documentable max_documents_allowed: 3,
max_file_size: 3.megabytes,
accepted_content_types: [ "application/pdf" ]
translates :title, :description, touch: true
include Globalizable
belongs_to :milestoneable, polymorphic: true
belongs_to :status
validates :milestoneable, presence: true
validates :publication_date, presence: true
validate :description_or_status_present?
scope :order_by_publication_date, -> { order(publication_date: :asc, created_at: :asc) }
scope :published, -> { where("publication_date <= ?", Date.current) }
scope :with_status, -> { where("status_id IS NOT NULL") }
def self.title_max_length
80
end
def description_or_status_present?
unless description.present? || status_id.present?
errors.add(:description)
end
end
end

View File

@@ -1,4 +1,4 @@
class Budget::Investment::Status < ActiveRecord::Base class Milestone::Status < ActiveRecord::Base
acts_as_paranoid column: :hidden_at acts_as_paranoid column: :hidden_at
has_many :milestones has_many :milestones

View File

@@ -57,7 +57,7 @@
<% if feature?(:budgets) %> <% if feature?(:budgets) %>
<li class="section-title <%= "is-active" if controller_name == "budgets" || <li class="section-title <%= "is-active" if controller_name == "budgets" ||
controller_name == "budget_investment_statuses" %>"> controller_name == "milestone_statuses" %>">
<%= link_to admin_budgets_path do %> <%= link_to admin_budgets_path do %>
<span class="icon-budget"></span> <span class="icon-budget"></span>
<strong><%= t("admin.menu.budgets") %></strong> <strong><%= t("admin.menu.budgets") %></strong>

View File

@@ -8,12 +8,12 @@
{ include_blank: @statuses.any? ? '' : t('admin.milestones.form.no_statuses_defined') }, { include_blank: @statuses.any? ? '' : t('admin.milestones.form.no_statuses_defined') },
{ disabled: @statuses.blank? } %> { disabled: @statuses.blank? } %>
<%= link_to t('admin.milestones.form.admin_statuses'), <%= link_to t('admin.milestones.form.admin_statuses'),
admin_budget_investment_statuses_path %> admin_milestone_statuses_path %>
</div> </div>
<%= f.translatable_fields do |translations_form| %> <%= f.translatable_fields do |translations_form| %>
<%= translations_form.hidden_field :title, value: l(Time.current, format: :datetime), <%= translations_form.hidden_field :title, value: l(Time.current, format: :datetime),
maxlength: Budget::Investment::Milestone.title_max_length %> maxlength: Milestone.title_max_length %>
<%= translations_form.text_area :description, <%= translations_form.text_area :description,
rows: 5, rows: 5,

View File

@@ -1,5 +0,0 @@
<%= back_link_to admin_budget_investment_statuses_path %>
<h2><%= t("admin.statuses.edit.title") %></h2>
<%= render '/admin/budget_investment_statuses/form' %>

View File

@@ -1,5 +0,0 @@
<%= back_link_to admin_budget_investment_statuses_path %>
<h2><%= t("admin.statuses.new.title") %></h2>
<%= render '/admin/budget_investment_statuses/form' %>

View File

@@ -18,7 +18,7 @@
<td class="text-center"><%= milestone.id %></td> <td class="text-center"><%= milestone.id %></td>
<td> <td>
<%= link_to milestone.title, <%= link_to milestone.title,
edit_admin_budget_budget_investment_budget_investment_milestone_path(@investment.budget, edit_admin_budget_budget_investment_milestone_path(@investment.budget,
@investment, @investment,
milestone) %> milestone) %>
</td> </td>
@@ -46,7 +46,7 @@
</td> </td>
<td class="small-2"> <td class="small-2">
<%= link_to t("admin.milestones.index.delete"), <%= link_to t("admin.milestones.index.delete"),
admin_budget_budget_investment_budget_investment_milestone_path(@investment.budget, admin_budget_budget_investment_milestone_path(@investment.budget,
@investment, @investment,
milestone), milestone),
method: :delete, method: :delete,

View File

@@ -63,6 +63,6 @@
<p> <p>
<%= link_to t("admin.budget_investments.show.new_milestone"), <%= link_to t("admin.budget_investments.show.new_milestone"),
new_admin_budget_budget_investment_budget_investment_milestone_path(@budget, @investment), new_admin_budget_budget_investment_milestone_path(@budget, @investment),
class: "button hollow" %> class: "button hollow" %>
</p> </p>

View File

@@ -0,0 +1,5 @@
<%= back_link_to admin_milestone_statuses_path %>
<h2><%= t("admin.statuses.edit.title") %></h2>
<%= render '/admin/milestone_statuses/form' %>

View File

@@ -1,7 +1,7 @@
<h2 class="inline-block"><%= t("admin.statuses.index.title") %></h2> <h2 class="inline-block"><%= t("admin.statuses.index.title") %></h2>
<%= link_to t("admin.statuses.index.new_status"), <%= link_to t("admin.statuses.index.new_status"),
new_admin_budget_investment_status_path, new_admin_milestone_status_path,
class: "button float-right margin-right" %> class: "button float-right margin-right" %>
<% if @statuses.any? %> <% if @statuses.any? %>
@@ -15,7 +15,7 @@
</thead> </thead>
<tbody> <tbody>
<% @statuses.each do |status| %> <% @statuses.each do |status| %>
<tr id="<%= dom_id(status) %>" class="budget_investment_status"> <tr id="<%= dom_id(status) %>" class="milestone_status">
<td> <td>
<%= status.name %> <%= status.name %>
</td> </td>
@@ -24,10 +24,10 @@
</td> </td>
<td> <td>
<%= link_to t("admin.statuses.index.edit"), <%= link_to t("admin.statuses.index.edit"),
edit_admin_budget_investment_status_path(status), edit_admin_milestone_status_path(status),
method: :get, class: "button hollow" %> method: :get, class: "button hollow" %>
<%= link_to t("admin.statuses.index.delete"), <%= link_to t("admin.statuses.index.delete"),
admin_budget_investment_status_path(status), admin_milestone_status_path(status),
method: :delete, class: "button hollow alert" %> method: :delete, class: "button hollow alert" %>
</td> </td>
</tr> </tr>

View File

@@ -0,0 +1,5 @@
<%= back_link_to admin_milestone_statuses_path %>
<h2><%= t("admin.statuses.new.title") %></h2>
<%= render '/admin/milestone_statuses/form' %>

View File

@@ -7,8 +7,8 @@ module ActionDispatch::Routing::UrlFor
case resource.class.name case resource.class.name
when "Budget::Investment" when "Budget::Investment"
[resource.budget, resource] [resource.budget, resource]
when "Budget::Investment::Milestone" when "Milestone"
[resource.investment.budget, resource.investment, resource] [resource.milestoneable.budget, resource.milestoneable, resource]
when "Legislation::Annotation" when "Legislation::Annotation"
[resource.draft_version.process, resource.draft_version, resource] [resource.draft_version.process, resource.draft_version, resource]
when "Legislation::Proposal", "Legislation::Question", "Legislation::DraftVersion" when "Legislation::Proposal", "Legislation::Question", "Legislation::DraftVersion"

View File

@@ -86,12 +86,12 @@ ar:
organization_name: "إذا كنت تقترح بإسم جماعي/منظمة, أو نيابة عن أشخاص آخرين, اكتب إسمها" organization_name: "إذا كنت تقترح بإسم جماعي/منظمة, أو نيابة عن أشخاص آخرين, اكتب إسمها"
image: "اقتراح صورة وصفية" image: "اقتراح صورة وصفية"
image_title: "عنوان الصورة" image_title: "عنوان الصورة"
budget/investment/milestone: milestone:
status_id: "حالة الإستثمار الحالية (إختياري)" status_id: "حالة الإستثمار الحالية (إختياري)"
title: "العنوان" title: "العنوان"
description: "الوصف (إختياري ان كان هناك حالة معينة)" description: "الوصف (إختياري ان كان هناك حالة معينة)"
publication_date: "تاريخ النشر" publication_date: "تاريخ النشر"
budget/investment/status: milestone/status:
name: "الاسم" name: "الاسم"
description: "الوصف (إختياري)" description: "الوصف (إختياري)"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ ast:
budget/investment: budget/investment:
one: "Proyectu de inversión" one: "Proyectu de inversión"
other: "Proyectos d'inversión" other: "Proyectos d'inversión"
budget/investment/milestone: milestone:
one: "finxu" one: "finxu"
other: "finxos" other: "finxos"
comment: comment:

View File

@@ -10,7 +10,7 @@ ca:
budget/investment: budget/investment:
one: "Proposta d'inversió" one: "Proposta d'inversió"
other: "Propostes d'inversió" other: "Propostes d'inversió"
budget/investment/milestone: milestone:
one: "fita" one: "fita"
other: "fites" other: "fites"
comment: comment:

View File

@@ -10,10 +10,10 @@ de:
budget/investment: budget/investment:
one: "Ausgabenvorschlag" one: "Ausgabenvorschlag"
other: "Ausgabenvorschläge" other: "Ausgabenvorschläge"
budget/investment/milestone: milestone:
one: "Meilenstein" one: "Meilenstein"
other: "Meilensteine" other: "Meilensteine"
budget/investment/status: milestone/status:
one: "Status des Ausgabenvorschlags" one: "Status des Ausgabenvorschlags"
other: "Status der Ausgabenvorschläge" other: "Status der Ausgabenvorschläge"
comment: comment:
@@ -131,12 +131,12 @@ de:
organization_name: "Wenn Sie einen Vorschlag im Namen einer Gruppe, Organisation oder mehreren Personen einreichen, nennen Sie bitte dessen/deren Name/n" organization_name: "Wenn Sie einen Vorschlag im Namen einer Gruppe, Organisation oder mehreren Personen einreichen, nennen Sie bitte dessen/deren Name/n"
image: "Beschreibendes Bild zum Ausgabenvorschlag" image: "Beschreibendes Bild zum Ausgabenvorschlag"
image_title: "Bildtitel" image_title: "Bildtitel"
budget/investment/milestone: milestone:
status_id: "Derzeitiger Status des Ausgabenvorschlags (optional)" status_id: "Derzeitiger Status des Ausgabenvorschlags (optional)"
title: "Titel" title: "Titel"
description: "Beschreibung (optional, wenn kein Status zugewiesen ist)" description: "Beschreibung (optional, wenn kein Status zugewiesen ist)"
publication_date: "Datum der Veröffentlichung" publication_date: "Datum der Veröffentlichung"
budget/investment/status: milestone/status:
name: "Name" name: "Name"
description: "Beschreibung (optional)" description: "Beschreibung (optional)"
budget/heading: budget/heading:

View File

@@ -1,10 +1,10 @@
en-US: en-US:
activerecord: activerecord:
models: models:
budget/investment/milestone: milestone:
one: "Meilenstein" one: "Meilenstein"
other: "Meilensteine" other: "Meilensteine"
budget/investment/status: milestone/status:
one: "Investitionsstatus, Anlagenstatus" one: "Investitionsstatus, Anlagenstatus"
other: "Investitionsstatus, Anlagenstatus" other: "Investitionsstatus, Anlagenstatus"
comment: comment:

View File

@@ -10,12 +10,12 @@ en:
budget/investment: budget/investment:
one: "Investment" one: "Investment"
other: "Investments" other: "Investments"
budget/investment/milestone: milestone:
one: "milestone" one: "milestone"
other: "milestones" other: "milestones"
budget/investment/status: milestone/status:
one: "Investment status" one: "Milestone Status"
other: "Investment statuses" other: "Milestone Statuses"
comment: comment:
one: "Comment" one: "Comment"
other: "Comments" other: "Comments"
@@ -131,12 +131,12 @@ en:
organization_name: "If you are proposing in the name of a collective/organization, or on behalf of more people, write its name" organization_name: "If you are proposing in the name of a collective/organization, or on behalf of more people, write its name"
image: "Proposal descriptive image" image: "Proposal descriptive image"
image_title: "Image title" image_title: "Image title"
budget/investment/milestone: milestone:
status_id: "Current investment status (optional)" status_id: "Current investment status (optional)"
title: "Title" title: "Title"
description: "Description (optional if there's an status assigned)" description: "Description (optional if there's an status assigned)"
publication_date: "Publication date" publication_date: "Publication date"
budget/investment/status: milestone/status:
name: "Name" name: "Name"
description: "Description (optional)" description: "Description (optional)"
budget/heading: budget/heading:

View File

@@ -286,24 +286,24 @@ en:
notice: Milestone successfully deleted notice: Milestone successfully deleted
statuses: statuses:
index: index:
title: Investment statuses title: Milestone statuses
empty_statuses: There are no investment statuses created empty_statuses: There are no milestone statuses created
new_status: Create new investment status new_status: Create new milestone status
table_name: Name table_name: Name
table_description: Description table_description: Description
table_actions: Actions table_actions: Actions
delete: Delete delete: Delete
edit: Edit edit: Edit
edit: edit:
title: Edit investment status title: Edit milestone status
update: update:
notice: Investment status updated successfully notice: Milestone status updated successfully
new: new:
title: Create investment status title: Create milestone status
create: create:
notice: Investment status created successfully notice: Milestone status created successfully
delete: delete:
notice: Investment status deleted successfully notice: Milestone status deleted successfully
comments: comments:
index: index:
filter: Filter filter: Filter

View File

@@ -7,10 +7,10 @@ es-AR:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
budget/investment/status: milestone/status:
one: "Estado de Inversiones" one: "Estado de Inversiones"
other: "Estado de Inversiones" other: "Estado de Inversiones"
comment: comment:
@@ -113,12 +113,12 @@ es-AR:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
status_id: "Estado de inversión actual ( opcional)" status_id: "Estado de inversión actual ( opcional)"
title: "Título" title: "Título"
description: "Descripción (opcional si hay estado asignado)" description: "Descripción (opcional si hay estado asignado)"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/investment/status: milestone/status:
name: "Nombre" name: "Nombre"
description: "Descripción (opcional)" description: "Descripción (opcional)"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-BO:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-BO:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -10,10 +10,10 @@ es-CL:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
budget/investment/status: milestone/status:
one: "Estado de la inversión" one: "Estado de la inversión"
other: "Estados de las inversiones" other: "Estados de las inversiones"
comment: comment:
@@ -128,12 +128,12 @@ es-CL:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
status_id: "Estado actual de la inversión (opcional)" status_id: "Estado actual de la inversión (opcional)"
title: "Título" title: "Título"
description: "Descripción (opcional si hay una condición asignada)" description: "Descripción (opcional si hay una condición asignada)"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/investment/status: milestone/status:
name: "Nombre" name: "Nombre"
description: "Descripción (opcional)" description: "Descripción (opcional)"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-CO:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-CO:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-CR:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-CR:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-DO:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-DO:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-EC:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-EC:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-GT:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-GT:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-HN:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-HN:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -10,10 +10,10 @@ es-MX:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
budget/investment/status: milestone/status:
one: "Estado de inversión" one: "Estado de inversión"
other: "Estados de inversión" other: "Estados de inversión"
comment: comment:
@@ -128,11 +128,11 @@ es-MX:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
description: "Descripción (opcional si cuenta con un estado asignado)" description: "Descripción (opcional si cuenta con un estado asignado)"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/investment/status: milestone/status:
name: "Nombre" name: "Nombre"
description: "Descripción (opcional)" description: "Descripción (opcional)"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-NI:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-NI:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-PA:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-PA:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-PE:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-PE:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-PR:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-PR:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-PY:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-PY:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-SV:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-SV:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-UY:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-UY:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ es-VE:
budget/investment: budget/investment:
one: "Proyecto de inversión" one: "Proyecto de inversión"
other: "Proyectos de inversión" other: "Proyectos de inversión"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
comment: comment:
@@ -104,7 +104,7 @@ es-VE:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva de la propuesta de inversión" image: "Imagen descriptiva de la propuesta de inversión"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
title: "Título" title: "Título"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/heading: budget/heading:

View File

@@ -10,12 +10,12 @@ es:
budget/investment: budget/investment:
one: "Proyecto de gasto" one: "Proyecto de gasto"
other: "Proyectos de gasto" other: "Proyectos de gasto"
budget/investment/milestone: milestone:
one: "hito" one: "hito"
other: "hitos" other: "hitos"
budget/investment/status: milestone/status:
one: "Estado del proyecto" one: "Estado de seguimiento"
other: "Estados del proyecto" other: "Estados de seguimiento"
comment: comment:
one: "Comentario" one: "Comentario"
other: "Comentarios" other: "Comentarios"
@@ -131,12 +131,12 @@ es:
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre" organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
image: "Imagen descriptiva del proyecto de gasto" image: "Imagen descriptiva del proyecto de gasto"
image_title: "Título de la imagen" image_title: "Título de la imagen"
budget/investment/milestone: milestone:
status_id: "Estado actual del proyecto (opcional)" status_id: "Estado actual del proyecto (opcional)"
title: "Título" title: "Título"
description: "Descripción (opcional si hay un estado asignado)" description: "Descripción (opcional si hay un estado asignado)"
publication_date: "Fecha de publicación" publication_date: "Fecha de publicación"
budget/investment/status: milestone/status:
name: "Nombre" name: "Nombre"
description: "Descripción (opcional)" description: "Descripción (opcional)"
budget/heading: budget/heading:

View File

@@ -286,24 +286,24 @@ es:
notice: Hito borrado correctamente notice: Hito borrado correctamente
statuses: statuses:
index: index:
title: Estados de proyectos title: Estados de seguimiento
empty_statuses: Aún no se ha creado ningún estado de proyecto empty_statuses: Aún no se ha creado ningún estado de seguimiento
new_status: Crear nuevo estado de proyecto new_status: Crear nuevo estado de seguimiento
table_name: Nombre table_name: Nombre
table_description: Descripción table_description: Descripción
table_actions: Acciones table_actions: Acciones
delete: Borrar delete: Borrar
edit: Editar edit: Editar
edit: edit:
title: Editar estado de proyecto title: Editar estado de seguimiento
update: update:
notice: Estado de proyecto editado correctamente notice: Estado de seguimiento editado correctamente
new: new:
title: Crear estado de proyecto title: Crear estado de seguimiento
create: create:
notice: Estado de proyecto creado correctamente notice: Estado de seguimiento creado correctamente
delete: delete:
notice: Estado de proyecto eliminado correctamente notice: Estado de seguimiento eliminado correctamente
comments: comments:
index: index:
filter: Filtro filter: Filtro

View File

@@ -10,7 +10,7 @@ fa:
budget/investment: budget/investment:
one: "سرمایه گذاری" one: "سرمایه گذاری"
other: "سرمایه گذاری ها" other: "سرمایه گذاری ها"
budget/investment/milestone: milestone:
one: "نقطه عطف" one: "نقطه عطف"
other: "نقاط عطف" other: "نقاط عطف"
comment: comment:
@@ -119,7 +119,7 @@ fa:
organization_name: "اگر شما به نام یک گروه / سازمان، یا از طرف افراد بیشتری پیشنهاد می کنید، نام آنها را بنویسید." organization_name: "اگر شما به نام یک گروه / سازمان، یا از طرف افراد بیشتری پیشنهاد می کنید، نام آنها را بنویسید."
image: "تصویر طرح توصیفی" image: "تصویر طرح توصیفی"
image_title: "عنوان تصویر" image_title: "عنوان تصویر"
budget/investment/milestone: milestone:
title: "عنوان" title: "عنوان"
publication_date: "تاریخ انتشار" publication_date: "تاریخ انتشار"
budget/heading: budget/heading:

View File

@@ -10,10 +10,10 @@ fr:
budget/investment: budget/investment:
one: "Projet d'investissement" one: "Projet d'investissement"
other: "Projets d'investissement" other: "Projets d'investissement"
budget/investment/milestone: milestone:
one: "jalon" one: "jalon"
other: "jalons" other: "jalons"
budget/investment/status: milestone/status:
one: "Statut dinvestissement" one: "Statut dinvestissement"
other: "Statuts dinvestissement" other: "Statuts dinvestissement"
comment: comment:
@@ -128,12 +128,12 @@ fr:
organization_name: "Si votre proposition se fait au nom d'un collectif ou d'une organisation, renseignez leur nom" organization_name: "Si votre proposition se fait au nom d'un collectif ou d'une organisation, renseignez leur nom"
image: "Image descriptive de la proposition" image: "Image descriptive de la proposition"
image_title: "Titre de l'image" image_title: "Titre de l'image"
budget/investment/milestone: milestone:
status_id: "Statut actuel de l'investissement (facultatif)" status_id: "Statut actuel de l'investissement (facultatif)"
title: "Titre" title: "Titre"
description: "Description (facultative si un statut est affecté)" description: "Description (facultative si un statut est affecté)"
publication_date: "Date de publication" publication_date: "Date de publication"
budget/investment/status: milestone/status:
name: "Nom" name: "Nom"
description: "Description (facultative)" description: "Description (facultative)"
budget/heading: budget/heading:

View File

@@ -10,10 +10,10 @@ gl:
budget/investment: budget/investment:
one: "Investimento" one: "Investimento"
other: "Investimentos" other: "Investimentos"
budget/investment/milestone: milestone:
one: "fito" one: "fito"
other: "fitos" other: "fitos"
budget/investment/status: milestone/status:
one: "Estado do investimento" one: "Estado do investimento"
other: "Estado dos investimentos" other: "Estado dos investimentos"
comment: comment:
@@ -131,12 +131,12 @@ gl:
organization_name: "Se estás a propor no nome dunha organización, dun colectivo ou de mais xente, escribe o seu nome" organization_name: "Se estás a propor no nome dunha organización, dun colectivo ou de mais xente, escribe o seu nome"
image: "Imaxe descritiva da proposta" image: "Imaxe descritiva da proposta"
image_title: "Título da imaxe" image_title: "Título da imaxe"
budget/investment/milestone: milestone:
status_id: "Estado do investimento actual (opcional)" status_id: "Estado do investimento actual (opcional)"
title: "Título" title: "Título"
description: "Descrición (opcional se hai unha condición asignada)" description: "Descrición (opcional se hai unha condición asignada)"
publication_date: "Data de publicación" publication_date: "Data de publicación"
budget/investment/status: milestone/status:
name: "Nome" name: "Nome"
description: "Descrición (opcional)" description: "Descrición (opcional)"
budget/heading: budget/heading:

View File

@@ -7,7 +7,7 @@ id:
other: "Anggaran" other: "Anggaran"
budget/investment: budget/investment:
other: "Investasi" other: "Investasi"
budget/investment/milestone: milestone:
other: "batu peringatan" other: "batu peringatan"
comment: comment:
other: "Komentar" other: "Komentar"
@@ -81,7 +81,7 @@ id:
organization_name: "Jika Anda usulkan dalam nama kolektif/organisasi, atau atas nama orang lain, menulis namanya" organization_name: "Jika Anda usulkan dalam nama kolektif/organisasi, atau atas nama orang lain, menulis namanya"
image: "Gambar deskriptif proposal" image: "Gambar deskriptif proposal"
image_title: "Judul gambar" image_title: "Judul gambar"
budget/investment/milestone: milestone:
title: "Judul" title: "Judul"
publication_date: "Tanggal publikasi" publication_date: "Tanggal publikasi"
budget/heading: budget/heading:

View File

@@ -10,10 +10,10 @@ it:
budget/investment: budget/investment:
one: "Investimento" one: "Investimento"
other: "Investimenti" other: "Investimenti"
budget/investment/milestone: milestone:
one: "traguardo" one: "traguardo"
other: "traguardi" other: "traguardi"
budget/investment/status: milestone/status:
one: "Status dellinvestimento" one: "Status dellinvestimento"
other: "Status dellinvestimento" other: "Status dellinvestimento"
comment: comment:
@@ -128,12 +128,12 @@ it:
organization_name: "Se presenti una proposta a nome di un collettivo o di unorganizzazione, ovvero per conto di più persone, indicane il nome" organization_name: "Se presenti una proposta a nome di un collettivo o di unorganizzazione, ovvero per conto di più persone, indicane il nome"
image: "Immagine descrittiva della proposta" image: "Immagine descrittiva della proposta"
image_title: "Titolo dellimmagine" image_title: "Titolo dellimmagine"
budget/investment/milestone: milestone:
status_id: "Stato attuale dellinvestimento (facoltativo)" status_id: "Stato attuale dellinvestimento (facoltativo)"
title: "Titolo" title: "Titolo"
description: "Descrizione (facoltativa se cè gia uno stato assegnato)" description: "Descrizione (facoltativa se cè gia uno stato assegnato)"
publication_date: "Data di pubblicazione" publication_date: "Data di pubblicazione"
budget/investment/status: milestone/status:
name: "Nome" name: "Nome"
description: "Descrizione (facoltativa)" description: "Descrizione (facoltativa)"
budget/heading: budget/heading:

View File

@@ -10,7 +10,7 @@ nl:
budget/investment: budget/investment:
one: "Investerning" one: "Investerning"
other: "Investeringen" other: "Investeringen"
budget/investment/milestone: milestone:
one: "mijlpaal" one: "mijlpaal"
other: "mijlpalen" other: "mijlpalen"
comment: comment:
@@ -122,12 +122,12 @@ nl:
organization_name: "Als je een voorstel doet uit naam van een collectief/organisatie, voer dan hier de naam in" organization_name: "Als je een voorstel doet uit naam van een collectief/organisatie, voer dan hier de naam in"
image: "Afbeelding ter omschrijving van het voorstel" image: "Afbeelding ter omschrijving van het voorstel"
image_title: "Naam van de afbeelding" image_title: "Naam van de afbeelding"
budget/investment/milestone: milestone:
status_id: "Huidige investeringsstatus (optioneel)" status_id: "Huidige investeringsstatus (optioneel)"
title: "Titel" title: "Titel"
description: "Omschrijving" description: "Omschrijving"
publication_date: "Publicatiedatum" publication_date: "Publicatiedatum"
budget/investment/status: milestone/status:
name: "Naam" name: "Naam"
description: "Beschrijving (optioneel)" description: "Beschrijving (optioneel)"
budget/heading: budget/heading:

View File

@@ -6,12 +6,12 @@ pl:
few: "Inwestycje" few: "Inwestycje"
many: "Inwestycji" many: "Inwestycji"
other: "Inwestycji" other: "Inwestycji"
budget/investment/milestone: milestone:
one: "kamień milowy" one: "kamień milowy"
few: "kamienie milowe" few: "kamienie milowe"
many: "kamieni milowych" many: "kamieni milowych"
other: "kamieni milowych" other: "kamieni milowych"
budget/investment/status: milestone/status:
one: "Etap inwestycji" one: "Etap inwestycji"
few: "Etapy inwestycji" few: "Etapy inwestycji"
many: "Etapów inwestycji" many: "Etapów inwestycji"
@@ -158,12 +158,12 @@ pl:
organization_name: "Jeśli wnioskujesz w imieniu zespołu/organizacji, lub w imieniu większej liczby osób, wpisz ich nazwę" organization_name: "Jeśli wnioskujesz w imieniu zespołu/organizacji, lub w imieniu większej liczby osób, wpisz ich nazwę"
image: "Opisowy obraz wniosku" image: "Opisowy obraz wniosku"
image_title: "Tytuł obrazu" image_title: "Tytuł obrazu"
budget/investment/milestone: milestone:
status_id: "Bieżący stan inwestycji (opcjonalnie)" status_id: "Bieżący stan inwestycji (opcjonalnie)"
title: "Tytuł" title: "Tytuł"
description: "Opis (opcjonalnie, jeśli istnieje przydzielony stan)" description: "Opis (opcjonalnie, jeśli istnieje przydzielony stan)"
publication_date: "Data publikacji" publication_date: "Data publikacji"
budget/investment/status: milestone/status:
name: "Nazwa" name: "Nazwa"
description: "Opis (opcjonalnie)" description: "Opis (opcjonalnie)"
budget/heading: budget/heading:

View File

@@ -10,10 +10,10 @@ pt-BR:
budget/investment: budget/investment:
one: "Investimento" one: "Investimento"
other: "Investimentos" other: "Investimentos"
budget/investment/milestone: milestone:
one: "Marco" one: "Marco"
other: "Marcos" other: "Marcos"
budget/investment/status: milestone/status:
one: "Status de investimento" one: "Status de investimento"
other: "Status dos investimentos" other: "Status dos investimentos"
comment: comment:
@@ -128,12 +128,12 @@ pt-BR:
organization_name: "Se você está propondo em nome de um coletivo / organização, ou em nome de mais pessoas, escreva seu nome" organization_name: "Se você está propondo em nome de um coletivo / organização, ou em nome de mais pessoas, escreva seu nome"
image: "Imagem descritiva da proposta" image: "Imagem descritiva da proposta"
image_title: "Título da imagem" image_title: "Título da imagem"
budget/investment/milestone: milestone:
status_id: "Status atual do investimento (opcional)" status_id: "Status atual do investimento (opcional)"
title: "Título" title: "Título"
description: "Descrição (opcional, se houver uma condição atribuída)" description: "Descrição (opcional, se houver uma condição atribuída)"
publication_date: "Data de publicação" publication_date: "Data de publicação"
budget/investment/status: milestone/status:
name: "Nome" name: "Nome"
description: "Descrição (opcional)" description: "Descrição (opcional)"
budget/heading: budget/heading:

View File

@@ -22,12 +22,12 @@ ru:
organization_name: "Если вы делаете предложение от имени коллектива/организации или от имени большего числа людей, напишите его название" organization_name: "Если вы делаете предложение от имени коллектива/организации или от имени большего числа людей, напишите его название"
image: "Иллюстративное изображение предложения" image: "Иллюстративное изображение предложения"
image_title: "Название изображения" image_title: "Название изображения"
budget/investment/milestone: milestone:
status_id: "Текущий инвестиционный статус (опционально)" status_id: "Текущий инвестиционный статус (опционально)"
title: "Название" title: "Название"
description: "Описание (опционально, если присвоен статус)" description: "Описание (опционально, если присвоен статус)"
publication_date: "Дата публикации" publication_date: "Дата публикации"
budget/investment/status: milestone/status:
name: "Имя" name: "Имя"
description: "Описание (опционально)" description: "Описание (опционально)"
budget/heading: budget/heading:

View File

@@ -10,10 +10,10 @@ sq:
budget/investment: budget/investment:
one: "Investim" one: "Investim"
other: "Investim" other: "Investim"
budget/investment/milestone: milestone:
one: "moment historik" one: "moment historik"
other: "milestone" other: "milestone"
budget/investment/status: milestone/status:
one: "Statusi investimeve" one: "Statusi investimeve"
other: "Statusi investimeve" other: "Statusi investimeve"
comment: comment:
@@ -128,12 +128,12 @@ sq:
organization_name: "Nëse propozoni në emër të një kolektivi / organizate, ose në emër të më shumë njerëzve, shkruani emrin e tij" organization_name: "Nëse propozoni në emër të një kolektivi / organizate, ose në emër të më shumë njerëzve, shkruani emrin e tij"
image: "Imazhi përshkrues i propozimit" image: "Imazhi përshkrues i propozimit"
image_title: "Titulli i imazhit" image_title: "Titulli i imazhit"
budget/investment/milestone: milestone:
status_id: "Statusi aktual i investimit (opsional)" status_id: "Statusi aktual i investimit (opsional)"
title: "Titull" title: "Titull"
description: "Përshkrimi (opsional nëse ka status të caktuar)" description: "Përshkrimi (opsional nëse ka status të caktuar)"
publication_date: "Data e publikimit" publication_date: "Data e publikimit"
budget/investment/status: milestone/status:
name: "Emri" name: "Emri"
description: "Përshkrimi (opsional)" description: "Përshkrimi (opsional)"
budget/heading: budget/heading:

View File

@@ -10,10 +10,10 @@ sv:
budget/investment: budget/investment:
one: "Budgetförslag" one: "Budgetförslag"
other: "Budgetförslag" other: "Budgetförslag"
budget/investment/milestone: milestone:
one: "milstolpe" one: "milstolpe"
other: "milstolpar" other: "milstolpar"
budget/investment/status: milestone/status:
one: "Budgetförslagets status" one: "Budgetförslagets status"
other: "Budgetförslagens status" other: "Budgetförslagens status"
comment: comment:
@@ -128,12 +128,12 @@ sv:
organization_name: "Organisation eller grupp i vars namn du lämnar förslaget" organization_name: "Organisation eller grupp i vars namn du lämnar förslaget"
image: "Förklarande bild till förslaget" image: "Förklarande bild till förslaget"
image_title: "Bildtext" image_title: "Bildtext"
budget/investment/milestone: milestone:
status_id: "Nuvarande status för budgetförslag (frivilligt fält)" status_id: "Nuvarande status för budgetförslag (frivilligt fält)"
title: "Titel" title: "Titel"
description: "Beskrivning (frivilligt fält om projektets status har ställts in)" description: "Beskrivning (frivilligt fält om projektets status har ställts in)"
publication_date: "Publiceringsdatum" publication_date: "Publiceringsdatum"
budget/investment/status: milestone/status:
name: "Namn" name: "Namn"
description: "Beskrivning (frivilligt fält)" description: "Beskrivning (frivilligt fält)"
budget/heading: budget/heading:

View File

@@ -10,7 +10,7 @@ tr:
budget/investment: budget/investment:
one: "yatırım" one: "yatırım"
other: "Yatırımlar" other: "Yatırımlar"
budget/investment/milestone: milestone:
one: "kilometre taşı" one: "kilometre taşı"
other: "kilometre taşları" other: "kilometre taşları"
comment: comment:

View File

@@ -10,10 +10,10 @@ val:
budget/investment: budget/investment:
one: "Proposta d'inversió" one: "Proposta d'inversió"
other: "Propostes d'inversió" other: "Propostes d'inversió"
budget/investment/milestone: milestone:
one: "fita" one: "fita"
other: "fites" other: "fites"
budget/investment/status: milestone/status:
one: "Estat de la proposta" one: "Estat de la proposta"
other: "Estat de les propostes" other: "Estat de les propostes"
comment: comment:
@@ -131,12 +131,12 @@ val:
organization_name: "Si estàs proposant en nom d'una associació o col·lectiu, escriu el seu nom" organization_name: "Si estàs proposant en nom d'una associació o col·lectiu, escriu el seu nom"
image: "Imatge descriptiva de la proposta d'inversió" image: "Imatge descriptiva de la proposta d'inversió"
image_title: "Títol de la imatge" image_title: "Títol de la imatge"
budget/investment/milestone: milestone:
status_id: "Estat actual de la proposta (opcional)" status_id: "Estat actual de la proposta (opcional)"
title: "Títol" title: "Títol"
description: "Descripció (opcional si hi ha un estat asignat)" description: "Descripció (opcional si hi ha un estat asignat)"
publication_date: "Data de publicació" publication_date: "Data de publicació"
budget/investment/status: milestone/status:
name: "Nom" name: "Nom"
description: "Descripció (opcional)" description: "Descripció (opcional)"
budget/heading: budget/heading:

View File

@@ -7,9 +7,9 @@ zh-CN:
other: "预算" other: "预算"
budget/investment: budget/investment:
other: "投资" other: "投资"
budget/investment/milestone: milestone:
other: "里程碑" other: "里程碑"
budget/investment/status: milestone/status:
other: "投资状态" other: "投资状态"
comment: comment:
other: "意见" other: "意见"
@@ -93,12 +93,12 @@ zh-CN:
organization_name: "如果你是以集体/组织的名义或者代表更多的人提出建议,写下它的名字。" organization_name: "如果你是以集体/组织的名义或者代表更多的人提出建议,写下它的名字。"
image: "建议说明性图像" image: "建议说明性图像"
image_title: "图像标题" image_title: "图像标题"
budget/investment/milestone: milestone:
status_id: "当前投资状况(可选)" status_id: "当前投资状况(可选)"
title: "标题" title: "标题"
description: "说明(如果指定了状态,则可选)" description: "说明(如果指定了状态,则可选)"
publication_date: "出版日期" publication_date: "出版日期"
budget/investment/status: milestone/status:
name: "名字" name: "名字"
description: "说明(可选)" description: "说明(可选)"
budget/heading: budget/heading:

View File

@@ -7,9 +7,9 @@ zh-TW:
other: "預算" other: "預算"
budget/investment: budget/investment:
other: "投資" other: "投資"
budget/investment/milestone: milestone:
other: "里程碑" other: "里程碑"
budget/investment/status: milestone/status:
other: "投資狀態" other: "投資狀態"
comment: comment:
other: "評論" other: "評論"
@@ -93,12 +93,12 @@ zh-TW:
organization_name: "如果您以集體/組織的名義,或代表多人提出建議,請寫下其名稱" organization_name: "如果您以集體/組織的名義,或代表多人提出建議,請寫下其名稱"
image: "建議說明性圖像" image: "建議說明性圖像"
image_title: "圖像標題" image_title: "圖像標題"
budget/investment/milestone: milestone:
status_id: "當前投資狀況 (可選擇填寫)" status_id: "當前投資狀況 (可選擇填寫)"
title: "標題" title: "標題"
description: "說明 (如果已經指定了狀態, 則可選擇填寫)" description: "說明 (如果已經指定了狀態, 則可選擇填寫)"
publication_date: "出版日期" publication_date: "出版日期"
budget/investment/status: milestone/status:
name: "名字" name: "名字"
description: "說明 (可選擇填寫)" description: "說明 (可選擇填寫)"
budget/heading: budget/heading:

View File

@@ -62,14 +62,14 @@ namespace :admin do
end end
resources :budget_investments, only: [:index, :show, :edit, :update] do resources :budget_investments, only: [:index, :show, :edit, :update] do
resources :budget_investment_milestones resources :milestones, controller: 'budget_investment_milestones'
member { patch :toggle_selection } member { patch :toggle_selection }
end end
resources :budget_phases, only: [:edit, :update] resources :budget_phases, only: [:edit, :update]
end end
resources :budget_investment_statuses, only: [:index, :new, :create, :update, :edit, :destroy] resources :milestone_statuses, only: [:index, :new, :create, :update, :edit, :destroy]
resources :signature_sheets, only: [:index, :new, :create, :show] resources :signature_sheets, only: [:index, :new, :create, :show]

View File

@@ -139,16 +139,16 @@ section "Creating Valuation Assignments" do
end end
end end
section "Creating default Investment Milestone Statuses" do section "Creating default Milestone Statuses" do
Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.studying_project')) Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.studying_project'))
Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.bidding')) Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.bidding'))
Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.executing_project')) Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.executing_project'))
Budget::Investment::Status.create(name: I18n.t('seeds.budgets.statuses.executed')) Milestone::Status.create(name: I18n.t('seeds.budgets.statuses.executed'))
end end
section "Creating investment milestones" do section "Creating investment milestones" do
Budget::Investment.find_each do |investment| Budget::Investment.find_each do |investment|
milestone = Budget::Investment::Milestone.new(investment_id: investment.id, publication_date: Date.tomorrow) milestone = investment.milestones.build(publication_date: Date.tomorrow, status_id: Milestone::Status.all.sample)
I18n.available_locales.map do |locale| I18n.available_locales.map do |locale|
Globalize.with_locale(locale) do Globalize.with_locale(locale) do
milestone.description = "Description for locale #{locale}" milestone.description = "Description for locale #{locale}"

View File

@@ -1,15 +1,12 @@
class AddTranslateMilestones < ActiveRecord::Migration class AddTranslateMilestones < ActiveRecord::Migration
def self.up def change
Budget::Investment::Milestone.create_translation_table!( create_table :budget_investment_milestone_translations do |t|
{ t.integer :budget_investment_milestone_id, null: false
title: :string, t.string :locale, null: false
description: :text t.string :title
}, t.text :description
{ migrate_data: true }
)
end
def self.down t.timestamps null: false
Budget::Investment::Milestone.drop_translation_table! end
end end
end end

View File

@@ -0,0 +1,12 @@
class ChangeBudgetInvestmentStatusesToMilestoneStatuses < ActiveRecord::Migration
def change
create_table :milestone_statuses do |t|
t.string :name
t.text :description
t.datetime :hidden_at, index: true
t.timestamps null: false
end
end
end

View File

@@ -0,0 +1,27 @@
class MakeInvestmentMilestonesPolymorphic < ActiveRecord::Migration
def change
create_table :milestones do |t|
t.references :milestoneable, polymorphic: true
t.string "title", limit: 80
t.text "description"
t.datetime "publication_date"
t.references :status, index: true
t.timestamps null: false
end
reversible do |change|
change.up do
Milestone.create_translation_table!({
title: :string,
description: :text
})
end
change.down do
Milestone.drop_translation_table!
end
end
end
end

View File

@@ -163,15 +163,12 @@ ActiveRecord::Schema.define(version: 20181016204729) do
create_table "budget_investment_milestone_translations", force: :cascade do |t| create_table "budget_investment_milestone_translations", force: :cascade do |t|
t.integer "budget_investment_milestone_id", null: false t.integer "budget_investment_milestone_id", null: false
t.string "locale", null: false t.string "locale", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "title" t.string "title"
t.text "description" t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end end
add_index "budget_investment_milestone_translations", ["budget_investment_milestone_id"], name: "index_6770e7675fe296cf87aa0fd90492c141b5269e0b", using: :btree
add_index "budget_investment_milestone_translations", ["locale"], name: "index_budget_investment_milestone_translations_on_locale", using: :btree
create_table "budget_investment_milestones", force: :cascade do |t| create_table "budget_investment_milestones", force: :cascade do |t|
t.integer "investment_id" t.integer "investment_id"
t.string "title", limit: 80 t.string "title", limit: 80
@@ -781,6 +778,41 @@ ActiveRecord::Schema.define(version: 20181016204729) do
add_index "map_locations", ["investment_id"], name: "index_map_locations_on_investment_id", using: :btree add_index "map_locations", ["investment_id"], name: "index_map_locations_on_investment_id", using: :btree
add_index "map_locations", ["proposal_id"], name: "index_map_locations_on_proposal_id", using: :btree add_index "map_locations", ["proposal_id"], name: "index_map_locations_on_proposal_id", using: :btree
create_table "milestone_statuses", force: :cascade do |t|
t.string "name"
t.text "description"
t.datetime "hidden_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_index "milestone_statuses", ["hidden_at"], name: "index_milestone_statuses_on_hidden_at", using: :btree
create_table "milestone_translations", force: :cascade do |t|
t.integer "milestone_id", null: false
t.string "locale", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "title"
t.text "description"
end
add_index "milestone_translations", ["locale"], name: "index_milestone_translations_on_locale", using: :btree
add_index "milestone_translations", ["milestone_id"], name: "index_milestone_translations_on_milestone_id", using: :btree
create_table "milestones", force: :cascade do |t|
t.integer "milestoneable_id"
t.string "milestoneable_type"
t.string "title", limit: 80
t.text "description"
t.datetime "publication_date"
t.integer "status_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_index "milestones", ["status_id"], name: "index_milestones_on_status_id", using: :btree
create_table "moderators", force: :cascade do |t| create_table "moderators", force: :cascade do |t|
t.integer "user_id" t.integer "user_id"
end end

View File

@@ -3,7 +3,7 @@ namespace :globalize do
[ [
AdminNotification, AdminNotification,
Banner, Banner,
Budget::Investment::Milestone, Milestone,
I18nContent, I18nContent,
Legislation::DraftVersion, Legislation::DraftVersion,
Legislation::Process, Legislation::Process,

View File

@@ -0,0 +1,106 @@
namespace :milestones do
def generate_table_migration_sql(new_table:, old_table:, columns:)
from_cols = ['id', *columns.keys]
to_cols = ['id', *columns.values]
<<~SQL
INSERT INTO #{new_table} (#{to_cols.join(', ')})
SELECT #{from_cols.join(', ')} FROM #{old_table};
SQL
end
def migrate_table!(new_table:, old_table:, columns:)
puts "Migrating data from '#{old_table}' to '#{new_table}'..."
result = ActiveRecord::Base.connection.execute(
generate_table_migration_sql(old_table: old_table,
new_table: new_table,
columns: columns)
)
puts "#{result.cmd_tuples} rows affected"
end
def populate_column!(table:, column:, value:)
puts "Populating column '#{column}' from table '#{table}' with '#{value}'..."
result = ActiveRecord::Base.connection.execute(
"UPDATE #{table} SET #{column} = '#{value}';"
)
puts "#{result.cmd_tuples} rows affected"
end
def count_rows(table)
ActiveRecord::Base.connection.query("SELECT COUNT(*) FROM #{table};")[0][0].to_i
end
desc "Migrate milestones and milestone status data after making the model polymorphic"
task migrate: :environment do
# This script copies all milestone-related data from the old tables to
# the new ones (preserving all primary keys). All 3 of the new tables
# must be empty.
#
# To clear the new tables to test this script:
#
# DELETE FROM milestone_statuses;
# DELETE FROM milestones;
# DELETE FROM milestone_translations;
#
start = Time.now
ActiveRecord::Base.transaction do
migrate_table! old_table: 'budget_investment_statuses',
new_table: 'milestone_statuses',
columns: {'name' => 'name',
'description' => 'description',
'hidden_at' => 'hidden_at',
'created_at' => 'created_at',
'updated_at' => 'updated_at'}
migrate_table! old_table: 'budget_investment_milestones',
new_table: 'milestones',
columns: {'investment_id' => 'milestoneable_id',
'title' => 'title',
'description' => 'description',
'created_at' => 'created_at',
'updated_at' => 'updated_at',
'publication_date' => 'publication_date',
'status_id' => 'status_id'}
populate_column! table: 'milestones',
column: 'milestoneable_type',
value: 'Budget::Investment'
migrate_table! old_table: 'budget_investment_milestone_translations',
new_table: 'milestone_translations',
columns: {'budget_investment_milestone_id' => 'milestone_id',
'locale' => 'locale',
'created_at' => 'created_at',
'updated_at' => 'updated_at',
'title' => 'title',
'description' => 'description'}
Image.where(imageable_type: "Budget::Investment::Milestone").
update_all(imageable_type: "Milestone")
Document.where(documentable_type: "Budget::Investment::Milestone").
update_all(documentable_type: "Milestone")
puts "Verifying that all rows were copied..."
{
"budget_investment_milestones" => "milestones",
"budget_investment_statuses" => "milestone_statuses",
"budget_investment_milestone_translations" => "milestone_translations"
}.each do |original_table, migrated_table|
ActiveRecord::Base.connection.execute(
"select setval('#{migrated_table}_id_seq', (select max(id) from #{migrated_table}));"
)
unless count_rows(original_table) == count_rows(migrated_table)
raise "Number of rows of old and new tables do not match! Rolling back transaction..."
end
end
end
puts "Finished in %.3f seconds" % (Time.now - start)
end
end

View File

@@ -193,14 +193,14 @@ FactoryBot.define do
reason "unfeasible" reason "unfeasible"
end end
factory :budget_investment_status, class: 'Budget::Investment::Status' do factory :milestone_status, class: 'Milestone::Status' do
sequence(:name) { |n| "Budget investment status #{n} name" } sequence(:name) { |n| "Milestone status #{n} name" }
sequence(:description) { |n| "Budget investment status #{n} description" } sequence(:description) { |n| "Milestone status #{n} description" }
end end
factory :budget_investment_milestone, class: 'Budget::Investment::Milestone' do factory :milestone, class: 'Milestone' do
association :investment, factory: :budget_investment association :milestoneable, factory: :budget_investment
association :status, factory: :budget_investment_status association :status, factory: :milestone_status
sequence(:title) { |n| "Budget investment milestone #{n} title" } sequence(:title) { |n| "Budget investment milestone #{n} title" }
description 'Milestone description' description 'Milestone description'
publication_date { Date.current } publication_date { Date.current }

View File

@@ -5,22 +5,22 @@ feature 'Admin budget investment milestones' do
background do background do
admin = create(:administrator) admin = create(:administrator)
login_as(admin.user) login_as(admin.user)
@investment = create(:budget_investment)
end end
let!(:investment) { create(:budget_investment) }
it_behaves_like "translatable", it_behaves_like "translatable",
"budget_investment_milestone", "milestone",
"edit_admin_budget_budget_investment_budget_investment_milestone_path", "edit_admin_budget_budget_investment_milestone_path",
%w[description] %w[description]
context "Index" do context "Index" do
scenario 'Displaying milestones' do scenario 'Displaying milestones' do
milestone = create(:budget_investment_milestone, investment: @investment) milestone = create(:milestone, milestoneable: investment)
create(:image, imageable: milestone) create(:image, imageable: milestone)
document = create(:document, documentable: milestone) document = create(:document, documentable: milestone)
visit admin_budget_budget_investment_path(@investment.budget, @investment) visit admin_budget_budget_investment_path(investment.budget, investment)
expect(page).to have_content("Milestone") expect(page).to have_content("Milestone")
expect(page).to have_content(milestone.title) expect(page).to have_content(milestone.title)
@@ -32,7 +32,7 @@ feature 'Admin budget investment milestones' do
end end
scenario 'Displaying no_milestones text' do scenario 'Displaying no_milestones text' do
visit admin_budget_budget_investment_path(@investment.budget, @investment) visit admin_budget_budget_investment_path(investment.budget, investment)
expect(page).to have_content("Milestone") expect(page).to have_content("Milestone")
expect(page).to have_content("Don't have defined milestones") expect(page).to have_content("Don't have defined milestones")
@@ -41,14 +41,14 @@ feature 'Admin budget investment milestones' do
context "New" do context "New" do
scenario "Add milestone" do scenario "Add milestone" do
status = create(:budget_investment_status) status = create(:milestone_status)
visit admin_budget_budget_investment_path(@investment.budget, @investment) visit admin_budget_budget_investment_path(investment.budget, investment)
click_link 'Create new milestone' click_link 'Create new milestone'
select status.name, from: 'budget_investment_milestone_status_id' select status.name, from: 'milestone_status_id'
fill_in 'Description', with: 'New description milestone' fill_in 'Description', with: 'New description milestone'
fill_in 'budget_investment_milestone_publication_date', with: Date.current fill_in 'milestone_publication_date', with: Date.current
click_button 'Create milestone' click_button 'Create milestone'
@@ -58,14 +58,14 @@ feature 'Admin budget investment milestones' do
end end
scenario "Status select is disabled if there are no statuses available" do scenario "Status select is disabled if there are no statuses available" do
visit admin_budget_budget_investment_path(@investment.budget, @investment) visit admin_budget_budget_investment_path(investment.budget, investment)
click_link 'Create new milestone' click_link 'Create new milestone'
expect(find("#budget_investment_milestone_status_id").disabled?).to be true expect(find("#milestone_status_id").disabled?).to be true
end end
scenario "Show validation errors on milestone form" do scenario "Show validation errors on milestone form" do
visit admin_budget_budget_investment_path(@investment.budget, @investment) visit admin_budget_budget_investment_path(investment.budget, investment)
click_link 'Create new milestone' click_link 'Create new milestone'
@@ -73,7 +73,7 @@ feature 'Admin budget investment milestones' do
click_button 'Create milestone' click_button 'Create milestone'
within "#new_budget_investment_milestone" do within "#new_milestone" do
expect(page).to have_content "can't be blank", count: 1 expect(page).to have_content "can't be blank", count: 1
expect(page).to have_content 'New description milestone' expect(page).to have_content 'New description milestone'
end end
@@ -82,11 +82,11 @@ feature 'Admin budget investment milestones' do
context "Edit" do context "Edit" do
scenario "Change title, description and document names" do scenario "Change title, description and document names" do
milestone = create(:budget_investment_milestone, investment: @investment) milestone = create(:milestone, milestoneable: investment)
create(:image, imageable: milestone) create(:image, imageable: milestone)
document = create(:document, documentable: milestone) document = create(:document, documentable: milestone)
visit admin_budget_budget_investment_path(@investment.budget, @investment) visit admin_budget_budget_investment_path(investment.budget, investment)
expect(page).to have_link document.title expect(page).to have_link document.title
click_link milestone.title click_link milestone.title
@@ -94,8 +94,8 @@ feature 'Admin budget investment milestones' do
expect(page).to have_css("img[alt='#{milestone.image.title}']") expect(page).to have_css("img[alt='#{milestone.image.title}']")
fill_in 'Description', with: 'Changed description' fill_in 'Description', with: 'Changed description'
fill_in 'budget_investment_milestone_publication_date', with: Date.current fill_in 'milestone_publication_date', with: Date.current
fill_in 'budget_investment_milestone_documents_attributes_0_title', with: 'New document title' fill_in 'milestone_documents_attributes_0_title', with: 'New document title'
click_button 'Update milestone' click_button 'Update milestone'
@@ -108,9 +108,9 @@ feature 'Admin budget investment milestones' do
context "Delete" do context "Delete" do
scenario "Remove milestone" do scenario "Remove milestone" do
milestone = create(:budget_investment_milestone, investment: @investment, title: "Title will it remove") milestone = create(:milestone, milestoneable: investment, title: "Title will it remove")
visit admin_budget_budget_investment_path(@investment.budget, @investment) visit admin_budget_budget_investment_path(investment.budget, investment)
click_link "Delete milestone" click_link "Delete milestone"

View File

@@ -1,95 +0,0 @@
require 'rails_helper'
feature 'Admin budget investment statuses' do
background do
admin = create(:administrator)
login_as(admin.user)
end
context "Index" do
scenario 'Displaying only not hidden statuses' do
status1 = create(:budget_investment_status)
status2 = create(:budget_investment_status)
status1.destroy
visit admin_budget_investment_statuses_path
expect(page).not_to have_content status1.name
expect(page).not_to have_content status1.description
expect(page).to have_content status2.name
expect(page).to have_content status2.description
end
scenario 'Displaying no statuses text' do
visit admin_budget_investment_statuses_path
expect(page).to have_content("There are no investment statuses created")
end
end
context "New" do
scenario "Create status" do
visit admin_budget_investment_statuses_path
click_link 'Create new investment status'
fill_in 'budget_investment_status_name', with: 'New status name'
fill_in 'budget_investment_status_description', with: 'This status description'
click_button 'Create Investment status'
expect(page).to have_content 'New status name'
expect(page).to have_content 'This status description'
end
scenario "Show validation errors in status form" do
visit admin_budget_investment_statuses_path
click_link 'Create new investment status'
fill_in 'budget_investment_status_description', with: 'This status description'
click_button 'Create Investment status'
within "#new_budget_investment_status" do
expect(page).to have_content "can't be blank", count: 1
end
end
end
context "Edit" do
scenario "Change name and description" do
status = create(:budget_investment_status)
visit admin_budget_investment_statuses_path
within("#budget_investment_status_#{status.id}") do
click_link "Edit"
end
fill_in 'budget_investment_status_name', with: 'Other status name'
fill_in 'budget_investment_status_description', with: 'Other status description'
click_button 'Update Investment status'
expect(page).to have_content 'Other status name'
expect(page).to have_content 'Other status description'
end
end
context "Delete" do
scenario "Hides status" do
status = create(:budget_investment_status)
visit admin_budget_investment_statuses_path
within("#budget_investment_status_#{status.id}") do
click_link "Delete"
end
expect(page).not_to have_content status.name
expect(page).not_to have_content status.description
end
end
end

View File

@@ -0,0 +1,95 @@
require 'rails_helper'
feature 'Admin milestone statuses' do
background do
admin = create(:administrator)
login_as(admin.user)
end
context "Index" do
scenario 'Displaying only not hidden statuses' do
status1 = create(:milestone_status)
status2 = create(:milestone_status)
status1.destroy
visit admin_milestone_statuses_path
expect(page).not_to have_content status1.name
expect(page).not_to have_content status1.description
expect(page).to have_content status2.name
expect(page).to have_content status2.description
end
scenario 'Displaying no statuses text' do
visit admin_milestone_statuses_path
expect(page).to have_content("There are no milestone statuses created")
end
end
context "New" do
scenario "Create status" do
visit admin_milestone_statuses_path
click_link 'Create new milestone status'
fill_in 'milestone_status_name', with: 'New status name'
fill_in 'milestone_status_description', with: 'This status description'
click_button 'Create Milestone Status'
expect(page).to have_content 'New status name'
expect(page).to have_content 'This status description'
end
scenario "Show validation errors in status form" do
visit admin_milestone_statuses_path
click_link 'Create new milestone status'
fill_in 'milestone_status_description', with: 'This status description'
click_button 'Create Milestone Status'
within "#new_milestone_status" do
expect(page).to have_content "can't be blank", count: 1
end
end
end
context "Edit" do
scenario "Change name and description" do
status = create(:milestone_status)
visit admin_milestone_statuses_path
within("#milestone_status_#{status.id}") do
click_link "Edit"
end
fill_in 'milestone_status_name', with: 'Other status name'
fill_in 'milestone_status_description', with: 'Other status description'
click_button 'Update Milestone Status'
expect(page).to have_content 'Other status name'
expect(page).to have_content 'Other status description'
end
end
context "Delete" do
scenario "Hides status" do
status = create(:milestone_status)
visit admin_milestone_statuses_path
within("#milestone_status_#{status.id}") do
click_link "Delete"
end
expect(page).not_to have_content status.name
expect(page).not_to have_content status.description
end
end
end

View File

@@ -12,7 +12,7 @@ feature 'Executions' do
let!(:investment3) { create(:budget_investment, :incompatible, heading: heading) } let!(:investment3) { create(:budget_investment, :incompatible, heading: heading) }
scenario 'only displays investments with milestones' do scenario 'only displays investments with milestones' do
create(:budget_investment_milestone, investment: investment1) create(:milestone, milestoneable: investment1)
visit budget_path(budget) visit budget_path(budget)
click_link 'See results' click_link 'See results'
@@ -28,7 +28,7 @@ feature 'Executions' do
end end
scenario "Do not display headings with no winning investments for selected status" do scenario "Do not display headings with no winning investments for selected status" do
create(:budget_investment_milestone, investment: investment1) create(:milestone, milestoneable: investment1)
empty_group = create(:budget_group, budget: budget) empty_group = create(:budget_group, budget: budget)
empty_heading = create(:budget_heading, group: empty_group, price: 1000) empty_heading = create(:budget_heading, group: empty_group, price: 1000)
@@ -46,7 +46,7 @@ feature 'Executions' do
end end
scenario "Show message when there are no winning investments with the selected status", :js do scenario "Show message when there are no winning investments with the selected status", :js do
create(:budget_investment_status, name: I18n.t('seeds.budgets.statuses.executed')) create(:milestone_status, name: I18n.t('seeds.budgets.statuses.executed'))
visit budget_path(budget) visit budget_path(budget)
@@ -63,7 +63,7 @@ feature 'Executions' do
context 'Images' do context 'Images' do
scenario 'renders milestone image if available' do scenario 'renders milestone image if available' do
milestone1 = create(:budget_investment_milestone, investment: investment1) milestone1 = create(:milestone, milestoneable: investment1)
create(:image, imageable: milestone1) create(:image, imageable: milestone1)
visit budget_path(budget) visit budget_path(budget)
@@ -76,7 +76,7 @@ feature 'Executions' do
end end
scenario 'renders investment image if no milestone image is available' do scenario 'renders investment image if no milestone image is available' do
create(:budget_investment_milestone, investment: investment2) create(:milestone, milestoneable: investment2)
create(:image, imageable: investment2) create(:image, imageable: investment2)
visit budget_path(budget) visit budget_path(budget)
@@ -89,7 +89,7 @@ feature 'Executions' do
end end
scenario 'renders default image if no milestone nor investment images are available' do scenario 'renders default image if no milestone nor investment images are available' do
create(:budget_investment_milestone, investment: investment4) create(:milestone, milestoneable: investment4)
visit budget_path(budget) visit budget_path(budget)
@@ -101,16 +101,16 @@ feature 'Executions' do
end end
scenario "renders last milestone's image if investment has multiple milestones with images associated" do scenario "renders last milestone's image if investment has multiple milestones with images associated" do
milestone1 = create(:budget_investment_milestone, investment: investment1, milestone1 = create(:milestone, milestoneable: investment1,
publication_date: Date.yesterday) publication_date: Date.yesterday)
milestone2 = create(:budget_investment_milestone, investment: investment1, milestone2 = create(:milestone, milestoneable: investment1,
publication_date: Date.yesterday) publication_date: Date.yesterday)
milestone3 = create(:budget_investment_milestone, investment: investment1, milestone3 = create(:milestone, milestoneable: investment1,
publication_date: Date.yesterday) publication_date: Date.yesterday)
milestone4 = create(:budget_investment_milestone, investment: investment1, milestone4 = create(:milestone, milestoneable: investment1,
publication_date: Date.yesterday) publication_date: Date.yesterday)
create(:image, imageable: milestone2, title: 'Image for first milestone with image') create(:image, imageable: milestone2, title: 'Image for first milestone with image')
@@ -129,15 +129,15 @@ feature 'Executions' do
context 'Filters' do context 'Filters' do
let!(:status1) { create(:budget_investment_status, name: I18n.t('seeds.budgets.statuses.studying_project')) } let!(:status1) { create(:milestone_status, name: "Studying the project") }
let!(:status2) { create(:budget_investment_status, name: I18n.t('seeds.budgets.statuses.bidding')) } let!(:status2) { create(:milestone_status, name: "Bidding") }
scenario 'Filters select with counter are shown' do scenario 'Filters select with counter are shown' do
create(:budget_investment_milestone, investment: investment1, create(:milestone, milestoneable: investment1,
publication_date: Date.yesterday, publication_date: Date.yesterday,
status: status1) status: status1)
create(:budget_investment_milestone, investment: investment2, create(:milestone, milestoneable: investment2,
publication_date: Date.yesterday, publication_date: Date.yesterday,
status: status2) status: status2)
@@ -152,9 +152,9 @@ feature 'Executions' do
end end
scenario 'by milestone status', :js do scenario 'by milestone status', :js do
create(:budget_investment_milestone, investment: investment1, status: status1) create(:milestone, milestoneable: investment1, status: status1)
create(:budget_investment_milestone, investment: investment2, status: status2) create(:milestone, milestoneable: investment2, status: status2)
create(:budget_investment_status, name: I18n.t('seeds.budgets.statuses.executing_project')) create(:milestone_status, name: I18n.t('seeds.budgets.statuses.executing_project'))
visit budget_path(budget) visit budget_path(budget)
@@ -181,11 +181,11 @@ feature 'Executions' do
end end
scenario 'are based on latest milestone status', :js do scenario 'are based on latest milestone status', :js do
create(:budget_investment_milestone, investment: investment1, create(:milestone, milestoneable: investment1,
publication_date: 1.month.ago, publication_date: 1.month.ago,
status: status1) status: status1)
create(:budget_investment_milestone, investment: investment1, create(:milestone, milestoneable: investment1,
publication_date: Date.yesterday, publication_date: Date.yesterday,
status: status2) status: status2)
@@ -201,11 +201,11 @@ feature 'Executions' do
end end
scenario 'milestones with future dates are not shown', :js do scenario 'milestones with future dates are not shown', :js do
create(:budget_investment_milestone, investment: investment1, create(:milestone, milestoneable: investment1,
publication_date: Date.yesterday, publication_date: Date.yesterday,
status: status1) status: status1)
create(:budget_investment_milestone, investment: investment1, create(:milestone, milestoneable: investment1,
publication_date: Date.tomorrow, publication_date: Date.tomorrow,
status: status2) status: status2)
@@ -226,7 +226,7 @@ feature 'Executions' do
def create_heading_with_investment_with_milestone(group:, name:) def create_heading_with_investment_with_milestone(group:, name:)
heading = create(:budget_heading, group: group, name: name) heading = create(:budget_heading, group: group, name: name)
investment = create(:budget_investment, :winner, heading: heading) investment = create(:budget_investment, :winner, heading: heading)
milestone = create(:budget_investment_milestone, investment: investment) milestone = create(:milestone, milestoneable: investment)
heading heading
end end
@@ -260,8 +260,8 @@ feature 'Executions' do
context 'No milestones' do context 'No milestones' do
scenario 'Milestone not yet published' do scenario 'Milestone not yet published' do
status = create(:budget_investment_status) status = create(:milestone_status)
unpublished_milestone = create(:budget_investment_milestone, investment: investment1, unpublished_milestone = create(:milestone, milestoneable: investment1,
status: status, publication_date: Date.tomorrow) status: status, publication_date: Date.tomorrow)
visit budget_executions_path(budget, status: status.id) visit budget_executions_path(budget, status: status.id)

View File

@@ -1121,11 +1121,11 @@ feature 'Budget Investments' do
scenario "Show milestones", :js do scenario "Show milestones", :js do
user = create(:user) user = create(:user)
investment = create(:budget_investment) investment = create(:budget_investment)
create(:budget_investment_milestone, investment: investment, create(:milestone, milestoneable: investment,
description_en: "Last milestone with a link to https://consul.dev", description_en: "Last milestone with a link to https://consul.dev",
description_es: "Último hito con el link https://consul.dev", description_es: "Último hito con el link https://consul.dev",
publication_date: Date.tomorrow) publication_date: Date.tomorrow)
first_milestone = create(:budget_investment_milestone, investment: investment, first_milestone = create(:milestone, milestoneable: investment,
description: "First milestone", description: "First milestone",
publication_date: Date.yesterday) publication_date: Date.yesterday)
image = create(:image, imageable: first_milestone) image = create(:image, imageable: first_milestone)

View File

@@ -1,15 +1,9 @@
require 'rails_helper' require 'rails_helper'
require 'rake'
describe 'Communities Rake' do describe 'Communities Rake' do
describe '#associate_community' do describe '#associate_community' do
before do
Rake.application.rake_require "tasks/communities"
Rake::Task.define_task(:environment)
end
let :run_rake_task do let :run_rake_task do
Rake::Task['communities:associate_community'].reenable Rake::Task['communities:associate_community'].reenable
Rake.application.invoke_task 'communities:associate_community' Rake.application.invoke_task 'communities:associate_community'

View File

@@ -1,7 +1,4 @@
require 'rake'
require 'rails_helper' require 'rails_helper'
Rake::Task.define_task(:environment)
Rake.application.rake_require('tasks/db')
describe 'rake db:dev_seed' do describe 'rake db:dev_seed' do
let :run_rake_task do let :run_rake_task do

View File

@@ -1,15 +1,9 @@
require "rails_helper" require "rails_helper"
require "rake"
describe "Globalize tasks" do describe "Globalize tasks" do
describe "#migrate_data" do describe "#migrate_data" do
before do
Rake.application.rake_require "tasks/globalize"
Rake::Task.define_task(:environment)
end
let :run_rake_task do let :run_rake_task do
Rake::Task["globalize:migrate_data"].reenable Rake::Task["globalize:migrate_data"].reenable
Rake.application.invoke_task "globalize:migrate_data" Rake.application.invoke_task "globalize:migrate_data"
@@ -151,7 +145,7 @@ describe "Globalize tasks" do
before { I18n.locale = :"pt-BR" } before { I18n.locale = :"pt-BR" }
let!(:milestone) do let!(:milestone) do
create(:budget_investment_milestone).tap do |milestone| create(:milestone).tap do |milestone|
milestone.translations.delete_all milestone.translations.delete_all
milestone.update_column(:title, "Português") milestone.update_column(:title, "Português")
milestone.reload milestone.reload

View File

@@ -1,6 +1,4 @@
require 'rake'
require 'rails_helper' require 'rails_helper'
Rails.application.load_tasks
describe 'rake map_locations:destroy' do describe 'rake map_locations:destroy' do
before do before do

View File

@@ -0,0 +1,147 @@
require "rails_helper"
describe "Milestones tasks" do
describe "#migrate" do
let :run_rake_task do
Rake::Task["milestones:migrate"].reenable
Rake.application.invoke_task "milestones:migrate"
end
let!(:investment) { create(:budget_investment) }
before do
ActiveRecord::Base.connection.execute(
"INSERT INTO budget_investment_statuses " +
"(name, description, hidden_at, created_at, updated_at) " +
"VALUES ('open', 'Good', NULL, '#{Time.current - 1.day}', '#{Time.current}');"
)
status_id = ActiveRecord::Base.connection.execute(
"SELECT MAX(id) FROM budget_investment_statuses;"
).to_a.first["max"]
milestone_attributes = {
investment_id: investment.id,
title: "First",
description: "Interesting",
publication_date: Date.yesterday,
status_id: status_id,
created_at: Time.current - 1.day,
updated_at: Time.current
}
ActiveRecord::Base.connection.execute(
"INSERT INTO budget_investment_milestones " +
"(#{milestone_attributes.keys.join(", ")}) " +
"VALUES (#{milestone_attributes.values.map { |value| "'#{value}'"}.join(", ")})"
)
end
it "migrates statuses" do
run_rake_task
expect(Milestone::Status.count).to be 1
status = Milestone::Status.first
expect(status.name).to eq "open"
expect(status.description).to eq "Good"
expect(status.hidden_at).to be nil
expect(status.created_at.to_date).to eq Date.yesterday
expect(status.updated_at.to_date).to eq Date.current
end
it "migrates milestones" do
run_rake_task
expect(Milestone.count).to be 1
milestone = Milestone.first
expect(milestone.milestoneable_id).to eq investment.id
expect(milestone.milestoneable_type).to eq "Budget::Investment"
expect(milestone.title).to eq "First"
expect(milestone.description).to eq "Interesting"
expect(milestone.publication_date).to eq Date.yesterday
expect(milestone.status_id).to eq Milestone::Status.first.id
expect(milestone.created_at.to_date).to eq Date.yesterday
expect(milestone.updated_at.to_date).to eq Date.current
end
it "Updates the primary key sequence correctly" do
run_rake_task
expect { create(:milestone) }.not_to raise_exception
end
context "Milestone has images and documents" do
let(:milestone_id) do
ActiveRecord::Base.connection.execute(
"SELECT MAX(id) FROM budget_investment_milestones;"
).to_a.first["max"]
end
let!(:image) do
create(:image, imageable_id: milestone_id).tap do |image|
image.update_column(:imageable_type, "Budget::Investment::Milestone")
end
end
let!(:document) do
create(:document, documentable_id: milestone_id).tap do |document|
document.update_column(:documentable_type, "Budget::Investment::Milestone")
end
end
it "migrates images and documents" do
run_rake_task
expect(Milestone.last.image).to eq image
expect(Milestone.last.documents).to eq [document]
end
end
context "Statuses had been deleted" do
before do
ActiveRecord::Base.connection.execute(
"INSERT INTO budget_investment_statuses " +
"(name, description, hidden_at, created_at, updated_at) " +
"VALUES ('deleted', 'Del', NULL, '#{Time.current - 1.day}', '#{Time.current}');"
)
ActiveRecord::Base.connection.execute(
"DELETE FROM budget_investment_statuses WHERE name='deleted'"
)
ActiveRecord::Base.connection.execute(
"INSERT INTO budget_investment_statuses " +
"(name, description, hidden_at, created_at, updated_at) " +
"VALUES ('new', 'New', NULL, '#{Time.current - 1.day}', '#{Time.current}');"
)
status_id = ActiveRecord::Base.connection.execute(
"SELECT MAX(id) FROM budget_investment_statuses;"
).to_a.first["max"]
milestone_attributes = {
investment_id: investment.id,
title: "Last",
description: "Different",
publication_date: Date.yesterday,
status_id: status_id,
created_at: Time.current - 1.day,
updated_at: Time.current
}
ActiveRecord::Base.connection.execute(
"INSERT INTO budget_investment_milestones " +
"(#{milestone_attributes.keys.join(", ")}) " +
"VALUES (#{milestone_attributes.values.map { |value| "'#{value}'"}.join(", ")})"
)
end
it "migrates the status id correctly" do
run_rake_task
expect(Milestone.last.status_id).to eq Milestone::Status.last.id
end
end
end
end

View File

@@ -1,15 +1,9 @@
require 'rails_helper' require 'rails_helper'
require 'rake'
describe 'Settings Rake' do describe 'Settings Rake' do
describe '#per_page_code_migration' do describe '#per_page_code_migration' do
before do
Rake.application.rake_require "tasks/settings"
Rake::Task.define_task(:environment)
end
let :run_rake_task do let :run_rake_task do
Rake::Task['settings:per_page_code_migration'].reenable Rake::Task['settings:per_page_code_migration'].reenable
Rake.application.invoke_task 'settings:per_page_code_migration' Rake.application.invoke_task 'settings:per_page_code_migration'

View File

@@ -1,7 +1,4 @@
require 'rake'
require 'rails_helper' require 'rails_helper'
Rails.application.load_tasks
Rake::Task.define_task(:environment)
feature 'rake sitemap:create' do feature 'rake sitemap:create' do
before do before do

View File

@@ -1,9 +1,9 @@
require 'rails_helper' require 'rails_helper'
describe Budget::Investment::Status do describe Milestone::Status do
describe "Validations" do describe "Validations" do
let(:status) { build(:budget_investment_status) } let(:status) { build(:milestone_status) }
it "is valid" do it "is valid" do
expect(status).to be_valid expect(status).to be_valid

View File

@@ -1,9 +1,9 @@
require 'rails_helper' require 'rails_helper'
describe Budget::Investment::Milestone do describe Milestone do
describe "Validations" do describe "Validations" do
let(:milestone) { build(:budget_investment_milestone) } let(:milestone) { build(:milestone) }
it "is valid" do it "is valid" do
expect(milestone).to be_valid expect(milestone).to be_valid
@@ -25,8 +25,8 @@ describe Budget::Investment::Milestone do
expect(milestone).to be_valid expect(milestone).to be_valid
end end
it "is not valid without an investment" do it "is not valid without a milestoneable" do
milestone.investment_id = nil milestone.milestoneable_id = nil
expect(milestone).not_to be_valid expect(milestone).not_to be_valid
end end
@@ -48,7 +48,7 @@ describe Budget::Investment::Milestone do
end end
describe "#description_or_status_present?" do describe "#description_or_status_present?" do
let(:milestone) { build(:budget_investment_milestone) } let(:milestone) { build(:milestone) }
it "is not valid when status is removed and there's no description" do it "is not valid when status is removed and there's no description" do
milestone.update(description: nil) milestone.update(description: nil)
@@ -71,14 +71,14 @@ describe Budget::Investment::Milestone do
describe ".published" do describe ".published" do
it "uses the application's time zone date", :with_different_time_zone do it "uses the application's time zone date", :with_different_time_zone do
published_in_local_time_zone = create(:budget_investment_milestone, published_in_local_time_zone = create(:milestone,
publication_date: Date.today) publication_date: Date.today)
published_in_application_time_zone = create(:budget_investment_milestone, published_in_application_time_zone = create(:milestone,
publication_date: Date.current) publication_date: Date.current)
expect(Budget::Investment::Milestone.published).to include(published_in_application_time_zone) expect(Milestone.published).to include(published_in_application_time_zone)
expect(Budget::Investment::Milestone.published).not_to include(published_in_local_time_zone) expect(Milestone.published).not_to include(published_in_local_time_zone)
end end
end end
end end

View File

@@ -12,6 +12,7 @@ require 'capybara/rails'
require 'capybara/rspec' require 'capybara/rspec'
require 'selenium/webdriver' require 'selenium/webdriver'
Rails.application.load_tasks if Rake::Task.tasks.empty?
I18n.default_locale = :en I18n.default_locale = :en
include Warden::Test::Helpers include Warden::Test::Helpers

View File

@@ -317,7 +317,7 @@ end
# even share the same colour. # even share the same colour.
def update_button_text def update_button_text
case translatable_class.name case translatable_class.name
when "Budget::Investment::Milestone" when "Milestone"
"Update milestone" "Update milestone"
when "AdminNotification" when "AdminNotification"
"Update notification" "Update notification"