Skip to content

Commit

Permalink
don't coerce headers stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
janxious committed Jun 17, 2013
1 parent 6a6adb6 commit 084da2c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ coverage
bin
repos
test/fixtures/repos
*.gem
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
= 0.0.8
* do not coerce headers

= 0.0.7
* support for setting custom email headers. Give us the hassssh.

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
active_mailer (0.0.7)
active_mailer (0.0.8)
activesupport (~> 3.2)
rails (~> 3.2)

Expand Down
2 changes: 1 addition & 1 deletion active_mailer.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Gem::Specification.new do |s|
s.authors = ["Matt Gordon"]
s.email = '[email protected]'
s.files = Dir["{app,lib,config}/**/*"] + ["MIT-LICENSE", "Rakefile", "Gemfile", "README.rdoc"]
s.version = "0.0.7"
s.version = "0.0.8"
s.homepage =
'https://github.com/expectedbehavior/active_mailer'

Expand Down
2 changes: 1 addition & 1 deletion app/models/active_mailer/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def define_action_mailer_method
:to => options[:recipients],
:subject => options[:subject],
:from => options[:sender].email_address }
mail_options[:headers] = options[:headers].to_json if options[:headers].present?
mail_options[:headers] = options[:headers] if options[:headers].present?
mail(mail_options)
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/active_mailer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class ActiveMailerTest < ActiveSupport::TestCase
email = InvitationEmail.new(:sender => "[email protected]",
:recipients => ["[email protected]", nil],
:subject => "YOU GUYS!")
email.headers = { :something => "else" }
email.headers = "SOMETHING: else"
assert { email.send! }
assert { email.mailer["headers"].to_s == '{"something":"else"}' }
assert { email.mailer["headers"].to_s == "SOMETHING: else" }
end
end

0 comments on commit 084da2c

Please sign in to comment.