Skip to content

Commit

Permalink
Fix depcrecation warnings and yaml syntax errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNaessens committed Feb 8, 2015
1 parent 9e64957 commit d5bb3a6
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/models/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ def deliver
if self.is_paid
self.tickets.all.map(&:deliver)
if self.paid > self.price
OrderMailer.notify_overpayment(self).deliver
OrderMailer.notify_overpayment(self).deliver_now
end
else
OrderMailer.confirm_order(self).deliver
OrderMailer.confirm_order(self).deliver_now
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/ticket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def deliver
self.generate_barcode
end

TicketMailer.ticket(self).deliver
TicketMailer.ticket(self).deliver_now
end

def generate_barcode
Expand Down
8 changes: 4 additions & 4 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def digest(*args)
end

# using httparty because it is much easier to read than net/http code
resp = HTTParty.get(Rails.application.config.fk_auth_url, :query => {
:k => digest(username, Rails.application.config.fk_auth_key),
resp = HTTParty.get(Rails.application.secrets.fk_auth_url, :query => {
:k => digest(username, Rails.application.secrets.fk_auth_key),
:u => username
})

Expand All @@ -47,7 +47,7 @@ def digest(*args)
hash = JSON[resp.body]

clubs_dig = hash['data'].map { |c| c['internalName'] }
dig = digest(Rails.application.config.fk_auth_salt, username, clubs_dig)
dig = digest(Rails.application.secrets.fk_auth_salt, username, clubs_dig)

# Process clubs if the controle is correct
if hash['controle'] == dig
Expand Down Expand Up @@ -91,7 +91,7 @@ def display_name
# fetch clubs where user is enrolled in
def fetch_enrolled_clubs
resp = HTTParty.get("http://registratie.fkgent.be/api/v2/members/clubs_for_ugent_nr.json", query:
{key: Rails.application.config.enrollment_key, ugent_nr: self.cas_ugentStudentID})
{key: Rails.application.secrets.enrolment_key, ugent_nr: self.cas_ugentStudentID})

if resp.code == 200
clubs = JSON[resp.body].map(&:downcase)
Expand Down
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ class Application < Rails::Application
# config.i18n.default_locale = :de
#
config.active_job.queue_adapter = :delayed_job

config.active_record.raise_in_transactional_callbacks = true
end
end
5 changes: 4 additions & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
config.eager_load = false

# Configure static asset server for tests with Cache-Control for performance.
config.serve_static_assets = true
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"

# Show full error reports and disable caching.
Expand All @@ -33,4 +33,7 @@

# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr

# Randomize test order
config.active_support.test_order = :random
end
5 changes: 5 additions & 0 deletions config/initializers/mute_papertrail_deprecation_warnings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
current_behavior = ActiveSupport::Deprecation.behavior
ActiveSupport::Deprecation.behavior = lambda do |message, callstack|
return if message =~ /`serialized_attributes` is deprecated without replacement/ && callstack.any? { |m| m =~ /paper_trail/ }
Array.wrap(current_behavior).each { |behavior| behavior.call(message, callstack) }
end
6 changes: 3 additions & 3 deletions config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ development:
fk_auth_url: 'http://fkgent.be/api_isengard_v2.php'
fk_auth_salt: '#development#'
fk_auth_key: '#development#'
enrollment_key: '#development#'
enrolment_key: '#development#'

test:
secret_key_base: '95182ec21cccb3c5ca9425bb8a45ec9327ae7e33e857395b689f38fc6d801e1185c7abb662190c2b8512f05e8087f0bab0f604f802b4c631431811b5b1d32a29'
fk_auth_url: 'http://fkgent.be/api_isengard_v2.php'
fk_auth_salt: '#development#'
fk_auth_key: '#development#'
enrollment_key: '#development#'
enrolment_key: '#development#'

production:
secret_key_base: 'a27fcd9aa2eabd14030493d6b5a1521ba09c9d23a1dd90b3c9d6914b8d226d1df8b46af3005f73a29c3ef1acd86de3669fbe08605d9ce8da73856c734f8a0e36'
fk_auth_url: 'http://fkgent.be/api_isengard_v2.php'
fk_auth_salt: '#development#'
fk_auth_key: '#development#'
enrollment_key: '#development#'
enrolment_key: '#development#'

0 comments on commit d5bb3a6

Please sign in to comment.