Permalink
Browse files

Message.deliver requires a third confirmation param to deliver in RAI…

…LS_ENV=development
  • Loading branch information...
1 parent aa43524 commit 923c84809e6ada0dd2cf113eee06ced707214719 @jasonm committed Nov 4, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 app/models/message.rb
@@ -12,7 +12,11 @@ class Message < ActiveRecord::Base
DATING_END = Time.zone.parse(DATING_END_STRING)
HANGUP_RESPONSE = '{"tropo": [{"hangup": null}]}'
- def self.deliver(to, message)
+ def self.deliver(to, message, deliver_in_development = false)
+ if Rails.env.development? && !deliver_in_development
+ raise "Tried to deliver an SMS in development without passing deliver_in_development = true."
+ end
+
Rails.logger.info "Enqueued SMS: TO: #{to}: #{message}"
params = Addressable::URI.new

0 comments on commit 923c848

Please sign in to comment.