Javi Martín
74088ac949
Make random IDs with the same seed consistent
...
The order of the array before being shuffled needs to be the same if we
want to have the same array after being shuffled with a certain seed.
We were using `pluck(:id)`, which doesn't guarantee the order of the
elements returned.
Replacing it with `order(:id).pluck(:id)` adds an `ORDER BY` clause and
so guarantees the order of the elements.
2019-04-03 21:21:11 +02:00
Julian Herrero
3ba961a2d7
Use double quotes in models
2019-03-14 17:25:43 +01:00
Javi Martín
6682121069
Reuse code to set and order by a random seed
2019-02-20 12:10:12 +01:00
Javi Martín
e3ca700e17
Add concerns to set and order by a random seed
2019-02-20 11:51:32 +01:00
Julian Herrero
d76782f150
Make budgets translatable
2019-02-13 11:41:58 +01:00
Julian Nicolas Herrero
0e9fd645e8
Merge pull request #3234 from consul/use_find_instead_of_find_by_id
...
[Backport] Use find instead of find_by_id
2019-01-30 19:46:22 +01:00
Julian Herrero
3bf2fa1b17
Add method find_by_slug_or_id to Sluggable module
...
Make it easier to find by slug or id for sluggable models. Will return
nil if resource is not found.
2019-01-25 09:08:28 +01:00
Javi Martín
e73f3bd97a
Add progress bars to milestones public view
2019-01-24 17:33:34 +01:00
Javi Martín
eaea95ccfb
Add progress bar model
2019-01-18 14:17:12 +01:00
Javi Martín
6f342baf7d
Move milestones scope to milestoneable concern
2018-12-11 19:22:55 +01:00
Marko Lovic
c0f6fa182f
Make Milestones general, and not specific to Budget Investments
...
Generalize the Budget::Investment::Milestone model to a
polymorphic Milestone model so it can be used for entities
other than Budget::Investment.
2018-11-30 14:15:21 +01:00
Javi Martín
93a7cb6c0f
Simplify code checking whether to enable a locale
2018-10-22 16:36:18 +02:00
Javi Martín
863b326142
Validate both the model and its translations
...
This way we guarantee there will be at least one translation for a model
and we keep compatibility with the rest of the application, which
ideally isn't aware of globalize.
2018-10-22 16:30:28 +02:00
Javi Martín
2ab49a1832
Refactor globalize models code using a concern
...
I've chosen the name "Globalizable" because "Translatable" already
existed.
2018-10-22 16:28:53 +02:00
Raúl Fuentes
376ce443ef
Add logic to user verification
...
changed functions on verification.rb, the first thing they do is
return true whene skip_user_verification is active.
changed show_welcome_screen? on user.rb, now its shows the welcome
page even with te option active.
changed welcome.html.erb, now if the user see this view and the
option is activated, all 4 checks are green, not only 2.
2018-05-22 15:02:35 +02:00
Bertocq
e0871e5dc6
Only update slug if empty or model condition is met
2018-02-04 23:04:48 +01:00
Bertocq
04de1e19f5
Make mappable 100 line length compliant
2018-02-02 21:51:49 +01:00
Angel Perez
665a5b57ab
Empty instances of MapLocation won't result in a new DB record ( #2220 )
2018-01-26 09:26:48 -04:00
rgarcia
96066aee44
Validates map presence only on create
...
As we are using an attr_accessor to make sure a user accepts that the
proposal “has no map”, the validation was being run in every save.
Making other things break, for example the updating of the counter
cache `cached_votes_up`, when someone voted for the proposal, as the
attr_accessor `skip_map` was not present
2017-12-26 12:39:29 +01:00
BertoCQ
d534b02b3c
Merge pull request #2206 from consul/related-contents-score
...
Related contents score
2017-12-20 15:13:12 +01:00
Bertocq
2e0dd9caea
Relationable find_related_content should not be used to find, refactored to have a single purpose
2017-12-20 02:36:13 +01:00
rgarcia
19a084c0c7
adds map validations
2017-12-19 20:32:55 +01:00
María Checa
7d8b5838b9
Added new related contents score method
2017-12-19 13:14:12 +01:00
decabeza
dfe077a30e
renames times_reported to flags_count on relationable.rb
2017-12-18 20:13:29 +01:00
Bertocq
b02e2729e7
Rubocop style autocorrections
2017-12-16 17:59:16 +01:00
rgarcia
2b52d26d82
refactors notifications into concerns and shared examples
2017-12-14 16:15:30 +01:00
Bertocq
3139d760ec
Remove unuseful comment on imageable concern
2017-12-12 12:38:54 +01:00
Bertocq
cd021aee4b
Add relationed_contents helper function on Relationable concern with spec
2017-11-29 19:02:25 +01:00
Bertocq
0482eb4098
Add report_related_content helper funcion on Relationable concern with spec
2017-11-29 19:02:25 +01:00
Bertocq
04dfc98c3f
Create RelatedContent model spec to check relationable destroy
2017-11-29 19:01:50 +01:00
Bertocq
8f3769aa7d
Create Relationable concern
2017-11-29 19:01:12 +01:00
Bertocq
ce0a7f6fad
Rubocop autocorrections
2017-10-17 22:00:00 +02:00
rgarcia
1cf9bc4ad1
adds images to anwers
2017-10-04 23:56:09 +02:00
Raimond Garcia
f68d86a2e5
Merge pull request #1824 from rockandror/user-recomendations
...
User recomendations
2017-09-29 19:02:03 +02:00
Senén Rodero Rodríguez
92c774cdeb
Merge with master
2017-09-28 13:36:20 +02:00
taitus
a0603985ef
Refactor.
2017-09-27 14:51:35 +02:00
Senén Rodero Rodríguez
f8d78ec4ab
Remove new_nested action from images controller. Use cocoon gem to manage new nested fields creation on images.
2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
88a7a29d27
Remove new_nested action from documents controller. Use cocoon gem to manage new nested fields creation on documents.
2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
6f71da07ee
Duplicate documentable code and rename for imageable
2017-09-26 13:55:03 +02:00
Bertocq
614ff79ba1
WIP
2017-09-26 13:53:43 +02:00
Bertocq
43758ba830
Fix Style/EmptyCaseCondition rubocop issue
2017-09-25 22:52:38 +02:00
Bertocq
22822aa173
Fix Style/RedundantParentheses rubocop issues
2017-09-25 22:44:58 +02:00
BertoCQ
f67ba62c49
Merge branch 'master' into user-recomendations
2017-09-19 18:56:12 +02:00
BertoCQ
87c99018e7
Merge branch 'master' into user-recomendations
2017-09-14 23:45:56 +02:00
Bertocq
e4e78c8f16
Rubocop autocorrections
2017-09-14 15:08:35 +02:00
taitus
9b6b57a24c
Remove all white spaces
2017-09-06 14:12:32 +02:00
Raimond Garcia
2519f232ab
Merge branch 'master' into user-recomendations
2017-09-05 17:15:42 +02:00
taitus
74958b461a
Add new model concern Communitable with relation, callback and associate community.
2017-09-05 12:54:32 +02:00
Alberto
c3b3a837a9
Merge branch 'master' into user-recomendations
2017-09-05 11:31:05 +02:00
Senén Rodero Rodríguez
38d4d59241
Add arguments to documentable concern to make it configurable for any recipient model.
2017-08-25 17:27:37 +02:00