decidim-budgets 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/decidim/budgets/feature.rb +9 -2
  3. metadata +11 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 694bf2875e01d780a5137bf484419e90dd84db2d
4
- data.tar.gz: 51bac82f3db35bea5708e4fb637222b192d5867d
3
+ metadata.gz: c1ffff78985c186a9bbdc02e12c2510d0d60c5c3
4
+ data.tar.gz: 41d497c709b62449310407a19f98fdb1931cb59f
5
5
  SHA512:
6
- metadata.gz: f40d8ea442f9b2282a6f427646521e77ca7e004128135b8a7288be63e97bf0bcda53af33fa4c4315ca530adc42b6dcfc4d0356358fb13a3b67c1bc4e2c3ae2d2
7
- data.tar.gz: 39acc62c5ff785912b1e6b17e821ac1e8c9eaf9b193d82bbb21f2dff83516359ab4ab3e6e5fd07839a1211ad4036a9b62c762bfdca6f65350d7057bdb51b691e
6
+ metadata.gz: 9bf6f9b486f67eba20d0a6af9685d627850712df3428b468a26dd57e1b0b53f7d8045487b688146b26874b9158b717a2f90b5d9bca0793bc86d1506d0cb907fb
7
+ data.tar.gz: a0737b4c93860d9da62f8b4d7899e5edd0bebe87a28dcf15d97c67916af0b47aae8ccf0f37e6efc74c5e8d279e3c12a40a5c8e2dc1d24f6ce63295a1e43c7d40
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_dependency "decidim/features/namer"
3
+ require "decidim/features/namer"
4
4
 
5
5
  Decidim.register_feature(:budgets) do |feature|
6
6
  feature.engine = Decidim::Budgets::Engine
@@ -19,10 +19,17 @@ Decidim.register_feature(:budgets) do |feature|
19
19
  resource.template = "decidim/budgets/projects/linked_projects"
20
20
  end
21
21
 
22
- feature.register_stat :projects_count, primary: true do |features, start_at, end_at|
22
+ feature.register_stat :projects_count, primary: true, priority: Decidim::StatsRegistry::HIGH_PRIORITY do |features, start_at, end_at|
23
23
  Decidim::Budgets::FilteredProjects.for(features, start_at, end_at).count
24
24
  end
25
25
 
26
+ feature.register_stat :orders_count do |features, start_at, end_at|
27
+ orders = Decidim::Budgets::Order.where(feature: features)
28
+ orders = orders.where("created_at >= ?", start_at) if start_at.present?
29
+ orders = orders.where("created_at <= ?", end_at) if end_at.present?
30
+ orders.count
31
+ end
32
+
26
33
  feature.register_stat :comments_count, tag: :comments do |features, start_at, end_at|
27
34
  projects = Decidim::Budgets::FilteredProjects.for(features, start_at, end_at)
28
35
  Decidim::Comments::Comment.where(root_commentable: projects).count
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-budgets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.4.2
21
+ version: 0.4.3
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 0.4.2
28
+ version: 0.4.3
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim-comments
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.4.2
35
+ version: 0.4.3
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.4.2
42
+ version: 0.4.3
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rectify
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -88,42 +88,42 @@ dependencies:
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.4.2
91
+ version: 0.4.3
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.4.2
98
+ version: 0.4.3
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: decidim-proposals
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - '='
104
104
  - !ruby/object:Gem::Version
105
- version: 0.4.2
105
+ version: 0.4.3
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - '='
111
111
  - !ruby/object:Gem::Version
112
- version: 0.4.2
112
+ version: 0.4.3
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: decidim-admin
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - '='
118
118
  - !ruby/object:Gem::Version
119
- version: 0.4.2
119
+ version: 0.4.3
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - '='
125
125
  - !ruby/object:Gem::Version
126
- version: 0.4.2
126
+ version: 0.4.3
127
127
  description: A budgets component for decidim's participatory processes.
128
128
  email:
129
129
  - josepjaume@gmail.com