trusty-festivity-extension 2.0.7 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/app/models/festivity_event_list.rb +12 -4
- data/lib/trusty-festivity-extension.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGQxN2I5NDA1ZjZlZWUxYzg0MWRlY2JjMmEwN2I1OWI5NDdiYzNhMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTYxZjIzZDNjMjdiNDRjM2Q5NDY0YzhlYmEyZjBjNjJmMzIwNDRiOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDMwYzJkZjQ2ZWM2NDYxZjk1MGVlZGJjOGIxM2Q4ZjUxNDczNDcwYWRhODJi
|
10
|
+
ZTgxYmMwNjlkMWE4OWFiMDZiNjI0OGU4NjNmMWMyZDU5Y2NiODA3ZDFlOWFi
|
11
|
+
NmJkYjVkOTM1MzQ0MmZiNjRlNGVlOTQ1YTM5MWU5YjZhY2IzNTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjA0YzQyOTlmZjVkODc2MjBkZDRiODNjNmQ5OTQ5NmMyOTE3YjU0NjhkMjc1
|
14
|
+
YzkzNzllNjcxYTMwNDUzMzc0NDgxMDBkMTgwNGU3ZWIyNDBkNmM4ZjBiMTRj
|
15
|
+
ZDVhYjcxMTUyZDc5YzAzNDFhZjNkMmJhNDA5MjU5NTJmZjJmOTE=
|
@@ -78,13 +78,21 @@ class FestivityEventList
|
|
78
78
|
# - The event ids returned, if any, are added to the where clause for the next query
|
79
79
|
# - Any category ids passed are added to the where clause as well.
|
80
80
|
def self.parse_criteria(criteria)
|
81
|
-
where_clause = {}
|
82
81
|
event_ids = event_ids_for_dates(criteria[:dates]) if criteria[:dates]
|
83
|
-
where_clause
|
84
|
-
where_clause
|
85
|
-
where_clause
|
82
|
+
where_clause = "site_id = #{ Page.current_site.id}"
|
83
|
+
where_clause += " AND event_id IN (#{event_ids.join(",")})" if event_ids
|
84
|
+
where_clause += " AND #{parse_categories(criteria[:categories].split(","))}" if criteria[:categories]
|
86
85
|
where_clause
|
87
86
|
end
|
88
87
|
|
88
|
+
def self.parse_categories(category_ids)
|
89
|
+
grouped_ids = FestivityCategory.find(category_ids).group_by {|category| category.festivity_category_type}
|
90
|
+
category_clauses = grouped_ids.map do |categories|
|
91
|
+
"page_id IN (SELECT page_id FROM festivity_page_categories WHERE festivity_category_id IN (#{categories[1].map {|category| category.id}.join(",")}))"
|
92
|
+
end
|
93
|
+
"(#{category_clauses.join(" AND ")})"
|
94
|
+
|
95
|
+
end
|
96
|
+
|
89
97
|
|
90
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trusty-festivity-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Sipple
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trusty-cms
|