Skip to content

Commit

Permalink
Remove deprecation warnings from app.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
unicornrainbow committed Mar 29, 2012
1 parent cd2aa13 commit ea5b2ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/apn_on_rails/app/models/apn/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class APN::App < APN::Base
has_many :unsent_group_notifications, :through => :groups

def cert
(RAILS_ENV == 'production' ? apn_prod_cert : apn_dev_cert)
(Rails.env.production?? apn_prod_cert : apn_dev_cert)
end

# Opens a connection to the Apple APN server and attempts to batch deliver
Expand All @@ -35,7 +35,7 @@ def self.send_notifications
end

def self.send_notifications_for_certs
cert_column = (RAILS_ENV == 'production' ? 'apn_prod_cert' : 'apn_dev_cert')
cert_column = (Rails.env.production?? 'apn_prod_cert' : 'apn_dev_cert')
apps = APN::App.all(
:conditions => "apn_apps.#{cert_column} is not null and apn_notifications.sent_at is null",
:joins => { :devices => :notifications }
Expand Down

0 comments on commit ea5b2ab

Please sign in to comment.