concerto_emergency 0.7 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c929e105126cf1ceb63a6d368faaf46a8167d131
4
- data.tar.gz: 8fafed26dc350f88032e43b354b293183458602b
3
+ metadata.gz: ae5b167fe1838320f01a54deb219434671fd73a5
4
+ data.tar.gz: 05ca46587948ef1b4d354706a75998d057aada44
5
5
  SHA512:
6
- metadata.gz: cdbd0cb8504c8222ee0e95624031994c3fdf10db58f6a6f5e90d4c102e470b347a851ff0f6cc2bd972a24ff61b988c8238800f521d9dd063505e7a848c3c297a
7
- data.tar.gz: e43bcb2694ccde5550a5d8282f0e8d217a02129854ad1dbb83db92fcbe23453688f3b85e31663c7ce65e90aafd87d71a077e457fe923c164410a85fe7ffbd967
6
+ metadata.gz: e77365dc568c0e369e8e18f9d97f78180bc5a6cdc2f2897b73e1b3b19b9ba372b2442b1e6f5711d1db8b43d2d6e653bc14cce7d9a7c94e6ffacb610fb1a52748
7
+ data.tar.gz: c72bb0080e297eca9b7e99b41dd58000b3934b9bcb31fb90a6b415180e345effee7cf2585ab7fa61d544357993cfe40d7e95dce0fdbb7004ef287bdd28d35a9c
@@ -27,10 +27,10 @@ module ConcertoEmergency
27
27
  add_controller_hook "Screen", :frontend_display, :before do
28
28
 
29
29
  emergency_feed = Feed.find_by_name(ConcertoConfig[:emergency_feed])
30
+ emergency_active = emergency_feed.submissions.approved.active.includes(:content).where("kind_id != 4").present?
30
31
 
31
32
  # Check for emergency content
32
- if not emergency_feed.nil? and not emergency_feed.submissions.approved.active.empty?
33
-
33
+ if not emergency_feed.nil? and emergency_active
34
34
  # swap template to emergency template if emergency content is present
35
35
  emergency_template = Template.find_by_name(ConcertoConfig[:emergency_template])
36
36
  if not emergency_template.nil?
@@ -44,13 +44,14 @@ module ConcertoEmergency
44
44
  add_controller_hook "Frontend::ContentsController", :index, :after do
45
45
 
46
46
  emergency_feed = Feed.find_by_name(ConcertoConfig[:emergency_feed])
47
+ emergency_active = emergency_feed.submissions.approved.active.includes(:content).where("kind_id != 4").present?
47
48
 
48
49
  if not emergency_feed.nil?
49
- emergency_submissions = emergency_feed.submissions.approved.active
50
+ emergency_submissions = emergency_feed.submissions.approved.active.includes(:content).where("kind_id = ?", @field.kind_id)
50
51
  emergency_contents = Array.new()
51
52
  emergency_submissions.each { |submission| emergency_contents << Content.find(submission.content_id) }
52
53
 
53
- if not emergency_contents.empty?
54
+ if emergency_active
54
55
 
55
56
  # Change template identifier so the screen knows a template
56
57
  # is used for emergency alerts
@@ -62,6 +63,8 @@ module ConcertoEmergency
62
63
  # Content supplied to screen is replaced with emergency contents
63
64
  @content = emergency_contents
64
65
  end
66
+ else
67
+ Rails.logger.error("could not find emergency feed #{ConcertoConfig[:emergency_feed]}")
65
68
  end
66
69
  end
67
70
 
@@ -1,3 +1,3 @@
1
1
  module ConcertoEmergency
2
- VERSION = "0.7"
2
+ VERSION = "0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concerto_emergency
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
4
+ version: '0.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Concerto Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-31 00:00:00.000000000 Z
11
+ date: 2015-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.2.2
121
+ rubygems_version: 2.4.5.1
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Broadcast emergency alerts on Concerto screens.