fireinc-apn_on_rails 0.4.2.11 → 0.4.2.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fireinc-apn_on_rails}
8
- s.version = "0.4.2.11"
8
+ s.version = "0.4.2.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["markbates", "Rebecca Nesson", "Caleb Adam Haye"]
@@ -45,15 +45,15 @@ class APN::App < APN::Base
45
45
  conditions = ["app_id = ?", app_id]
46
46
  end
47
47
  begin
48
- APN::Connection.open_for_delivery({:cert => the_cert}) do |conn, sock|
49
- APN::Device.find_each(:conditions => conditions) do |dev|
48
+ APN::Device.find_each(:conditions => conditions) do |dev|
49
+ APN::Connection.open_for_delivery({:cert => the_cert}) do |conn, sock|
50
50
  dev.unsent_notifications.each do |noty|
51
51
  conn.write(noty.message_for_sending)
52
52
  noty.sent_at = Time.now
53
53
  noty.save
54
54
  end
55
- sleep(1)
56
55
  end
56
+ sleep(1)
57
57
  end
58
58
  rescue Exception => e
59
59
  log_connection_exception(e)
@@ -15,7 +15,7 @@ class APN::Device < APN::Base
15
15
  has_many :unsent_notifications, :class_name => 'APN::Notification', :conditions => 'sent_at is null'
16
16
  belongs_to :user
17
17
 
18
- validates_uniqueness_of :token, :scope => :app_id
18
+ validates_uniqueness_of :token, :scope => :artist_id
19
19
  validates_format_of :token, :with => /^[a-z0-9]{8}\s[a-z0-9]{8}\s[a-z0-9]{8}\s[a-z0-9]{8}\s[a-z0-9]{8}\s[a-z0-9]{8}\s[a-z0-9]{8}\s[a-z0-9]{8}$/
20
20
 
21
21
  before_create :set_last_registered_at
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fireinc-apn_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 113
4
+ hash: 127
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 2
10
- - 11
11
- version: 0.4.2.11
10
+ - 12
11
+ version: 0.4.2.12
12
12
  platform: ruby
13
13
  authors:
14
14
  - markbates