Skip to content
Browse files

Added subscribes to campaign page

  • Loading branch information...
1 parent 01b517c commit a59ce16495d00d2c4ca76e208d1e8fe33b9a2775 Willa committed Nov 27, 2012
Showing with 9 additions and 2 deletions.
  1. +2 −2 lib/crowdring/ask.rb
  2. +4 −0 lib/crowdring/ringer.rb
  3. +3 −0 lib/views/campaign.haml
View
4 lib/crowdring/ask.rb
@@ -45,11 +45,11 @@ def potential_recipients(ringers)
ringers.reject {|r| r.tagged?(recipient_tag) }
end
- def recipients(ringers=Ringer.all)
+ def recipients(ringers=Ringer.subscribed)
ringers.select {|r| r.tagged?(recipient_tag)}
end
- def respondents(ringers=Ringer.all)
+ def respondents(ringers=Ringer.subscribed)
ringers.select {|r| r.tagged?(respondent_tag)}
end
View
4 lib/crowdring/ringer.rb
@@ -29,6 +29,10 @@ def self.unsubscribed
all(subscribed: false)
end
+ def self.subscribed
+ all(subscribed: true)
+ end
+
def phone_number=(number)
super Phoner::Phone.parse(number).to_s
end
View
3 lib/views/campaign.haml
@@ -55,6 +55,9 @@
= "#{@ring_count} " + (@ring_count !=1 ? 'Total Rings' : 'Total Ring')
%h4.unique_count
= "#{@ringer_count} " + (@ringer_count !=1 ? 'Unique Ringers' : 'Unique Ringer')
+ %h4.subscribed_count
+ -subscribes = @campaign.ringers.subscribed.count
+ = "#{subscribes} " + (subscribes !=1 ? 'Subscribed Ringers' : 'Subscribed Ringer')
#ringers-numbers
%ul.ringers
-@ringers.each do |ringer|

0 comments on commit a59ce16

Please sign in to comment.
Something went wrong with that request. Please try again.