Commit Graph

13635 Commits

Author SHA1 Message Date
Juanjo Bazán
7ab602175a makes models inherit from ApplicationRecord 2019-04-17 17:40:56 +02:00
Juanjo Bazán
1cec362ba7 fixes application_record parent 2019-04-17 17:40:56 +02:00
Juanjo Bazán
b7d9ef6377 models inherits from ApplicationRecord 2019-04-17 17:40:56 +02:00
Senén Rodero Rodríguez
aa3e8c8458 Keep method for not yet globalizable models
Maintain the method for models that are still translatable. This help
me to pass the CI build. In later PR's this method will be eliminated
as no one will invoke it.
2019-04-17 17:40:56 +02:00
Senén Rodero Rodríguez
0b3a3b97f7 Santitize description translations
Sanitize all not marked for destruction translations when description
is a translatable attribute.
2019-04-17 17:40:56 +02:00
Senén Rodero Rodríguez
a68098eaed Fix sanitization for translatable description attribute
Move method from sanitizable to globalizable concern because
globalize_accessors were overiding sanitizable method and was never
called. Another solution to this could be to load sanitizable
always after globalizable concern.

Old method implementation was not working well with globalize_accessors,
it was returning nil always.
2019-04-17 17:40:56 +02:00
taitus
638c80760f Fix queries and scopes after column deletion
Some queries were accessing original column instead of the new translatable one. This should have been causing unexpected behavior for requests maded in a different locale than the application default.
2019-04-17 17:40:56 +02:00
taitus
fbfe5b3468 Fix specs heading_specs.rb:313 2019-04-17 17:40:55 +02:00
Senén Rodero Rodríguez
7c5fa253f5 Fix queries and scopes after column deletion
Some queries were accessing original column instead of the new
translatable one. This should have been causing unexpected behavior
for requests maded in a different locale than the application default.
2019-04-17 17:40:55 +02:00
Senén Rodero Rodríguez
f87804aa90 Update helpers after globalize gem version update
Globalize has fixed new translations globalized_model initialization
so we have to adapt existing code.
2019-04-17 17:40:55 +02:00
Senén Rodero Rodríguez
596ef8d1ed Fix queries and scopes after column deletion
Some queries were accessing original column instead of the new
translatable one. This should have been causing unexpected behavior
for requests maded in a different locale than the application default.
2019-04-17 17:40:55 +02:00
Julian Herrero
1a21b779ac Fix deprecation warning calling `env' in controllers 2019-04-17 17:40:55 +02:00
alejandro
ceea0d4a36 sanitizes params for views 2019-04-17 17:40:55 +02:00
Julian Herrero
fb81f45a73 Fix redirect_to :back deprecation warning 2019-04-17 17:40:55 +02:00
Angel Perez
e7f39bc454 Use head :ok when expecting an empty response body 2019-04-17 17:40:55 +02:00
Angel Perez
ee2b87aedf Use .where clause first when calling .destroy_all method 2019-04-17 17:40:55 +02:00
Angel Perez
37aa082943 Fix redirect_to deprecation warning on Admin::Legislation::Processes controller 2019-04-17 17:40:55 +02:00
rgarcia
fca7ef6cc9 removes params deprecation warning 2019-04-17 17:40:55 +02:00
alejandro
e63f6eec49 removes controller spec deprecation warnings 2019-04-17 17:40:55 +02:00
rgarcia
9a49716f22 updates controller specs deprecation warnings 2019-04-17 17:40:55 +02:00
rgarcia
a910eb69cd removes stats controller spec deprecation warning 2019-04-17 17:40:55 +02:00
rgarcia
bca824b759 removes controller spec deprecation warnings 2019-04-17 17:40:55 +02:00
Juanjo Bazán
0f34cae2ad updates specs to new keyword styles 2019-04-17 17:40:55 +02:00
rgarcia
b62eff841c Fix symbolize_keys deprectation warning
DEPRECATION WARNING: Method symbolize_keys is deprecated and will be
removed in Rails 5.1, as `ActionController::Parameters` no longer
inherits from hash. Using this deprecated behavior exposes potential
security problems. If you continue to use this method you may be
creating a security vulnerability in your app that can be exploited.
Instead, consider using one of these documented methods which are not
deprecated:
http://api.rubyonrails.org/v5.0.4/classes/ActionController/Parameters.ht
ml (called from csv_params at
/home/travis/build/consul/consul/app/helpers/budgets_helper.rb:15)
2019-04-17 17:40:55 +02:00
Angel Perez
7ddbf5ff35 Use separator key when parameterizing arguments 2019-04-17 17:40:55 +02:00
Angel Perez
cb1ed017f9 Use separator key when parameterizing arguments 2019-04-17 17:40:55 +02:00
rgarcia
90bcfe7a78 Fix parameterise deprecation warning
DEPRECATION WARNING: Passing the separator argument as a positional
parameter is deprecated and will soon be removed. Use `separator: '_'`
instead. (called from followable_translation_key at
/home/travis/build/consul/consul/app/controllers/follows_controller.rb:2
5)
2019-04-17 17:40:55 +02:00
rgarcia
f23fd6f3bb Remove parameterise deprecation warning
DEPRECATION WARNING: Passing the separator argument as a positional
parameter is deprecated and will soon be removed. Use `separator: '_'`
instead.
2019-04-17 17:40:55 +02:00
rgarcia
c6ab5dbe1b Remove before_filter deprecation warning
DEPRECATION WARNING: before_filter is deprecated and will be removed in
Rails 5.1. Use before_action instead. (called from
<class:RegistrationsController> at
/home/travis/build/consul/consul/app/controllers/users/registrations_con
troller.rb:3)
2019-04-17 17:40:55 +02:00
rgarcia
b2b418284d Fix ActiveModel::Errors#[]= deprecation warning
DEPRECATION WARNING: ActiveModel::Errors#[]= is deprecated and will be
removed in Rails 5.1. Use model.errors.add(:attachment, "content type
image/png does not match any of accepted content types pdf") instead.
(called from validate_attachment_content_type at
/home/travis/build/consul/consul/app/models/document.rb:92)
2019-04-17 17:40:55 +02:00
Julian Herrero
f668317cc1 Use #data_source_exists? instead of #table_exists?
DEPRECATION WARNING: #table_exists? currently checks both tables and
views. This behavior is deprecated and will be changed with Rails 5.1
to only check tables. Use #data_source_exists? instead.
2019-04-17 17:40:55 +02:00
alejandro
b7a9995b38 fixes deprecation warning relate to raise_in_transactional_callbacks
As described in
http://edgeguides.rubyonrails.org/5_0_release_notes.html#active-record-notable-changes
2019-04-17 17:40:55 +02:00
rgarcia
930fc58173 fixes lock specs 2019-04-17 17:40:55 +02:00
rgarcia
a4f0161aa8 fixes specs related to ActionController params 2019-04-17 17:40:55 +02:00
alejandro
bafab3b769 fixes some deprecation warnings 2019-04-17 17:40:52 +02:00
Julian Nicolas Herrero
ad10a8e86b Merge pull request #3443 from consul/fix_bug_admin_print_investments
Fix bug moderator can't print voted investments in balloting phase
2019-04-17 17:31:12 +02:00
Raimond Garcia
da23468f0f Merge pull request #3441 from consul/spending_proposals_check_rake
Add rake task to check for spending proposals
2019-04-17 16:52:51 +02:00
voodoorai2000
e47a8be2a2 Add more log messages 2019-04-17 16:51:13 +02:00
voodoorai2000
aa04757e16 Add rake task to check for spending proposals 2019-04-17 16:50:32 +02:00
Raimond Garcia
d16c9b0b9c Merge pull request #3440 from consul/contributing
Update core team members, contributors and alumni
2019-04-17 16:48:23 +02:00
Julian Herrero
7e422f2187 Fix bug management print voted investments
If budget is in balloting phase and there are voted investments, it
was not possible to print budgets investments because the ballot was
never being loaded in the controller and therefore an error was raised
when rendering the view.

Failure/Error: <% if ballot.has_investment?(investment) %>

  ActionView::Template::Error:
    undefined method `has_investment?' for nil:NilClass
      app/views/budgets/investments/_ballot.html.erb:3
      app/views/budgets/investments/_investment.html.erb:88
      app/views/custom/management/budgets/investments/print.html.erb:26
2019-04-17 14:19:32 +02:00
Julian Herrero
e714713d0c Refactor long lines
Also, use method `have_link' instead of `have_css' to make tests more
readable
2019-04-17 14:18:35 +02:00
Julian Herrero
879591cc5c Use let instead of an instance variable 2019-04-17 14:16:54 +02:00
Julian Herrero
73ae74b2b1 Allow method to pass a user for login 2019-04-17 14:16:46 +02:00
voodoorai2000
14d8af3a06 Update CONTRIBUTING_ES.md 2019-04-16 17:38:23 +02:00
rgarcia
1077a632cb permits parameters in urls 2019-04-16 17:28:07 +02:00
Julian Herrero
dc88212b75 Remove Budget::Phase overrided translation class
Since Globalize gem update to v5.2.0 we cannot override translations
anymore in the same way that before the update. Milestone::Translation
class removed in this commit were no longer loaded correctly when
translation class is retrieved by translation_class method provided by
Globalize. Here is the diff between both gem versions:

https://github.com/globalize/globalize/compare/v5.0.0...v5.2.0diff-a1370b109e0dd567545b072bc6447b8fR51

This problem is not happening on test environment but is throwing an
exception in other environments as it has not loaded the delegation
definition inside our custom translation class.

To fix this we added a new class method inside globalizable model
concern to allow to define method delegation on translations classes from
parent globalizable classes when needed without having to override
Translation classes.

Since module Sanitizable takes care of traslations, it's enough to
include the module in order to correctly sanitize the description.
2019-04-16 17:28:07 +02:00
Julian Herrero
aa0b48badd Remove Budget::Heading overrided translation class
Since Globalize gem update to v5.2.0 we cannot override translations
anymore in the same way that before the update. Milestone::Translation
class removed in this commit were no longer loaded correctly when
translation class is retrieved by translation_class method provided by
Globalize. Here is the diff between both gem versions:

https://github.com/globalize/globalize/compare/v5.0.0...v5.2.0diff-a1370b109e0dd567545b072bc6447b8fR51

This problem is not happening on test environment but is throwing an
exception in other environments as it has not loaded the delegation
definition inside our custom translation class.

To fix this we added a new class method inside globalizable model
concern to allow to define method delegation on translations classes from
parent globalizable classes when needed without having to override
Translation classes.

Another way to properly load our custom Milestone::Translation class is
to place it inside parent model class.
2019-04-16 17:28:07 +02:00
Julian Herrero
9a15f3d160 Remove Budget overrided translation class
Since Globalize gem update to v5.2.0 we cannot override translations
anymore in the same way that before the update. Milestone::Translation
class removed in this commit were no longer loaded correctly when
translation class is retrieved by translation_class method provided by
Globalize. Here is the diff between both gem versions:

https://github.com/globalize/globalize/compare/v5.0.0...v5.2.0diff-a1370b109e0dd567545b072bc6447b8fR51

This problem is not happening on test environment but is throwing an
exception in other environments as it has not loaded the delegation
definition inside our custom translation class.

To fix this we added a new class method inside globalizable model
concern to allow to define method delegation on translations classes from
parent globalizable classes when needed without having to override
Translation classes.

Another way to properly load our custom Milestone::Translation class is
to place it inside parent model class.
2019-04-16 17:28:07 +02:00
Julian Herrero
e104369b67 Remove Budget::Group overrided translation class
Since Globalize gem update to v5.2.0 we cannot override translations
anymore in the same way that before the update. Milestone::Translation
class removed in this commit were no longer loaded correctly when
translation class is retrieved by translation_class method provided by
Globalize. Here is the diff between both gem versions:

https://github.com/globalize/globalize/compare/v5.0.0...v5.2.0diff-a1370b109e0dd567545b072bc6447b8fR51

This problem is not happening on test environment but is throwing an
exception in other environments as it has not loaded the delegation
definition inside our custom translation class.

To fix this we added a new class method inside globalizable model
concern to allow to define method delegation on translations classes from
parent globalizable classes when needed without having to override
Translation classes.

Another way to properly load our custom Translation class is
to place it inside parent model class.
2019-04-16 17:28:07 +02:00