From 38cfaa828502b2f5d137a6a2952c68ae5efc15b1 Mon Sep 17 00:00:00 2001 From: Andy Jeffries Date: Mon, 17 Nov 2014 10:44:04 +0000 Subject: Creates an ApplicationMailer and layout by default, including html and body tags to reduce spam score --- actionmailer/lib/rails/generators/mailer/mailer_generator.rb | 1 + .../lib/rails/generators/mailer/templates/application_mailer.rb | 4 ++++ actionmailer/lib/rails/generators/mailer/templates/mailer.rb | 3 +-- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 actionmailer/lib/rails/generators/mailer/templates/application_mailer.rb (limited to 'actionmailer') diff --git a/actionmailer/lib/rails/generators/mailer/mailer_generator.rb b/actionmailer/lib/rails/generators/mailer/mailer_generator.rb index d5bf864595..97a01f9ef3 100644 --- a/actionmailer/lib/rails/generators/mailer/mailer_generator.rb +++ b/actionmailer/lib/rails/generators/mailer/mailer_generator.rb @@ -8,6 +8,7 @@ module Rails def create_mailer_file template "mailer.rb", File.join('app/mailers', class_path, "#{file_name}.rb") + template "application_mailer.rb", File.join('app/mailers/application_mailer.rb') end hook_for :template_engine, :test_framework diff --git a/actionmailer/lib/rails/generators/mailer/templates/application_mailer.rb b/actionmailer/lib/rails/generators/mailer/templates/application_mailer.rb new file mode 100644 index 0000000000..d25d8892dd --- /dev/null +++ b/actionmailer/lib/rails/generators/mailer/templates/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout 'mailer' +end diff --git a/actionmailer/lib/rails/generators/mailer/templates/mailer.rb b/actionmailer/lib/rails/generators/mailer/templates/mailer.rb index edcfb4233d..bce64a5e6e 100644 --- a/actionmailer/lib/rails/generators/mailer/templates/mailer.rb +++ b/actionmailer/lib/rails/generators/mailer/templates/mailer.rb @@ -1,6 +1,5 @@ <% module_namespacing do -%> -class <%= class_name %> < ActionMailer::Base - default from: "from@example.com" +class <%= class_name %> < ApplicationMailer <% actions.each do |action| -%> # Subject can be set in your I18n file at config/locales/en.yml -- cgit v1.2.3 From a58da25d90962a39ad916fc4de22a0a0c81ba034 Mon Sep 17 00:00:00 2001 From: Andy Jeffries Date: Mon, 24 Nov 2014 09:37:32 +0000 Subject: Removing unnecessary File.join calls --- actionmailer/lib/rails/generators/mailer/mailer_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/rails/generators/mailer/mailer_generator.rb b/actionmailer/lib/rails/generators/mailer/mailer_generator.rb index 97a01f9ef3..094ec85114 100644 --- a/actionmailer/lib/rails/generators/mailer/mailer_generator.rb +++ b/actionmailer/lib/rails/generators/mailer/mailer_generator.rb @@ -8,7 +8,7 @@ module Rails def create_mailer_file template "mailer.rb", File.join('app/mailers', class_path, "#{file_name}.rb") - template "application_mailer.rb", File.join('app/mailers/application_mailer.rb') + template "application_mailer.rb", 'app/mailers/application_mailer.rb' end hook_for :template_engine, :test_framework -- cgit v1.2.3 From 9685080a7677abfa5d288a81c3e078368c6bb67c Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 23 Nov 2014 13:53:01 -0800 Subject: let mailer templates generate URLs by default [Xavier Noria, Richard Schneeman] --- actionmailer/CHANGELOG.md | 7 +++ .../fixtures/url_test_mailer/exercise_url_for.erb | 1 + actionmailer/test/url_test.rb | 60 ++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 actionmailer/test/fixtures/url_test_mailer/exercise_url_for.erb (limited to 'actionmailer') diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md index 5685871ac9..1b3e802cb2 100644 --- a/actionmailer/CHANGELOG.md +++ b/actionmailer/CHANGELOG.md @@ -1,3 +1,10 @@ +* `link_to` and `url_for` generate URLs by default in templates, it is no + longer needed to pass `only_path: false`. + + Fixes #16497 and #16589. + + *Xavier Noria*, *Richard Schneeman* + * Attachments can be added while rendering the mail template. Fixes #16974. diff --git a/actionmailer/test/fixtures/url_test_mailer/exercise_url_for.erb b/actionmailer/test/fixtures/url_test_mailer/exercise_url_for.erb new file mode 100644 index 0000000000..0322c1191e --- /dev/null +++ b/actionmailer/test/fixtures/url_test_mailer/exercise_url_for.erb @@ -0,0 +1 @@ +<%= url_for(@options) %> <%= @url %> diff --git a/actionmailer/test/url_test.rb b/actionmailer/test/url_test.rb index be7532d42f..8fce7c3827 100644 --- a/actionmailer/test/url_test.rb +++ b/actionmailer/test/url_test.rb @@ -23,9 +23,32 @@ class UrlTestMailer < ActionMailer::Base mail(to: recipient, subject: "[Signed up] Welcome #{recipient}", from: "system@loudthinking.com", date: Time.local(2004, 12, 12)) end + + def exercise_url_for(options) + @options = options + @url = url_for(@options) + mail(from: 'from@example.com', to: 'to@example.com', subject: 'subject') + end end class ActionMailerUrlTest < ActionMailer::TestCase + class DummyModel + def self.model_name + OpenStruct.new(route_key: 'dummy_model') + end + + def persisted? + false + end + + def model_name + self.class.model_name + end + + def to_model + self + end + end def encode( text, charset="UTF-8" ) quoted_printable( text, charset ) @@ -40,10 +63,47 @@ class ActionMailerUrlTest < ActionMailer::TestCase mail end + def assert_url_for(expected, options, relative: false) + expected = "http://www.basecamphq.com#{expected}" if expected.start_with?('/') && !relative + urls = UrlTestMailer.exercise_url_for(options).body.to_s.chomp.split + + assert_equal expected, urls.first + assert_equal expected, urls.second + end + def setup @recipient = 'test@localhost' end + def test_url_for + UrlTestMailer.delivery_method = :test + + AppRoutes.draw do + get ':controller(/:action(/:id))' + get '/welcome' => 'foo#bar', as: 'welcome' + get '/dummy_model' => 'foo#baz', as: 'dummy_model' + end + + # string + assert_url_for 'http://foo/', 'http://foo/' + + # symbol + assert_url_for '/welcome', :welcome + + # hash + assert_url_for '/a/b/c', controller: 'a', action: 'b', id: 'c' + assert_url_for '/a/b/c', {controller: 'a', action: 'b', id: 'c', only_path: true}, relative: true + + # model + assert_url_for '/dummy_model', DummyModel.new + + # class + assert_url_for '/dummy_model', DummyModel + + # array + assert_url_for '/dummy_model' , [DummyModel] + end + def test_signed_up_with_url UrlTestMailer.delivery_method = :test -- cgit v1.2.3 From cd902a0d1d06054019d6f60ab3580516031afceb Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 25 Nov 2014 09:28:16 +0800 Subject: Add missing CHANGELOG entry. --- actionmailer/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionmailer') diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md index 1b3e802cb2..9fdda52f77 100644 --- a/actionmailer/CHANGELOG.md +++ b/actionmailer/CHANGELOG.md @@ -1,3 +1,10 @@ +* MailerGenerator now generates layouts by default. HTML mailer layout will + include `` and `` tags which will help to reduce spam score in + some spam detection engines. Mailers will now inherit from `ApplicationMailer` + which sets the default layout. + + *Andy Jeffries* + * `link_to` and `url_for` generate URLs by default in templates, it is no longer needed to pass `only_path: false`. -- cgit v1.2.3 From ec49324bd764d62fc61399844cf4b547cf8bc831 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 25 Nov 2014 09:49:29 +0800 Subject: Update docs to reflect changes to MailerGenerator. --- actionmailer/lib/action_mailer/base.rb | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index a70bf1544a..23139bcbe8 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -15,11 +15,17 @@ module ActionMailer # # $ rails generate mailer Notifier # - # The generated model inherits from ActionMailer::Base. A mailer model defines methods + # The generated model inherits from ApplicationMailer which in turn + # inherits from ActionMailer::Base. A mailer model defines methods # used to generate an email message. In these methods, you can setup variables to be used in # the mailer views, options on the mail itself such as the :from address, and attachments. # - # class Notifier < ActionMailer::Base + # class ApplicationMailer < ActionMailer::Base + # default from: 'from@exmaple.com' + # layout 'mailer' + # end + # + # class Notifier < ApplicationMailer # default from: 'no-reply@example.com', # return_path: 'system@example.com' # @@ -84,7 +90,7 @@ module ActionMailer # name as the method in your mailer model. For example, in the mailer defined above, the template at # app/views/notifier/welcome.text.erb would be used to generate the email. # - # Variables defined in the methods of your mailer model are accessible as instance variables in their + # Variables defined in the methods of your mailer model are accessible as instance variables in their # corresponding view. # # Emails by default are sent in plain text, so a sample view for our model example might look like this: @@ -178,7 +184,7 @@ module ActionMailer # # Sending attachment in emails is easy: # - # class ApplicationMailer < ActionMailer::Base + # class Notifier < ApplicationMailer # def welcome(recipient) # attachments['free_book.pdf'] = File.read('path/to/file.pdf') # mail(to: recipient, subject: "New account information") @@ -194,7 +200,7 @@ module ActionMailer # If you need to send attachments with no content, you need to create an empty view for it, # or add an empty body parameter like this: # - # class ApplicationMailer < ActionMailer::Base + # class Notifier < ApplicationMailer # def welcome(recipient) # attachments['free_book.pdf'] = File.read('path/to/file.pdf') # mail(to: recipient, subject: "New account information", body: "") @@ -206,7 +212,7 @@ module ActionMailer # You can also specify that a file should be displayed inline with other HTML. This is useful # if you want to display a corporate logo or a photo. # - # class ApplicationMailer < ActionMailer::Base + # class Notifier < ApplicationMailer # def welcome(recipient) # attachments.inline['photo.png'] = File.read('path/to/photo.png') # mail(to: recipient, subject: "Here is what we look like") @@ -245,7 +251,7 @@ module ActionMailer # Action Mailer provides some intelligent defaults for your emails, these are usually specified in a # default method inside the class definition: # - # class Notifier < ActionMailer::Base + # class Notifier < ApplicationMailer # default sender: 'system@example.com' # end # @@ -263,7 +269,7 @@ module ActionMailer # As you can pass in any header, you need to either quote the header as a string, or pass it in as # an underscored symbol, so the following will work: # - # class Notifier < ActionMailer::Base + # class Notifier < ApplicationMailer # default 'Content-Transfer-Encoding' => '7bit', # content_description: 'This is a description' # end @@ -271,7 +277,7 @@ module ActionMailer # Finally, Action Mailer also supports passing Proc objects into the default hash, so you # can define methods that evaluate as the message is being generated: # - # class Notifier < ActionMailer::Base + # class Notifier < ApplicationMailer # default 'X-Special-Header' => Proc.new { my_method } # # private @@ -296,7 +302,7 @@ module ActionMailer # This may be useful, for example, when you want to add default inline attachments for all # messages sent out by a certain mailer class: # - # class Notifier < ActionMailer::Base + # class Notifier < ApplicationMailer # before_action :add_inline_attachment! # # def welcome @@ -703,7 +709,7 @@ module ActionMailer # The main method that creates the message and renders the email templates. There are # two ways to call this method, with a block, or without a block. # - # It accepts a headers hash. This hash allows you to specify + # It accepts a headers hash. This hash allows you to specify # the most used headers in an email message, these are: # # * +:subject+ - The subject of the message, if this is omitted, Action Mailer will -- cgit v1.2.3 From 79eedb346e103c5ff8e488b992c80b625c864097 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 24 Nov 2014 22:02:49 -0800 Subject: let the AM test suite pass in 1.9 --- actionmailer/test/url_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/test/url_test.rb b/actionmailer/test/url_test.rb index 8fce7c3827..7928fe9542 100644 --- a/actionmailer/test/url_test.rb +++ b/actionmailer/test/url_test.rb @@ -63,7 +63,7 @@ class ActionMailerUrlTest < ActionMailer::TestCase mail end - def assert_url_for(expected, options, relative: false) + def assert_url_for(expected, options, relative = false) expected = "http://www.basecamphq.com#{expected}" if expected.start_with?('/') && !relative urls = UrlTestMailer.exercise_url_for(options).body.to_s.chomp.split @@ -92,7 +92,7 @@ class ActionMailerUrlTest < ActionMailer::TestCase # hash assert_url_for '/a/b/c', controller: 'a', action: 'b', id: 'c' - assert_url_for '/a/b/c', {controller: 'a', action: 'b', id: 'c', only_path: true}, relative: true + assert_url_for '/a/b/c', {controller: 'a', action: 'b', id: 'c', only_path: true}, true # model assert_url_for '/dummy_model', DummyModel.new -- cgit v1.2.3 From e3f7817cec95ac395c9e1491178a1fad0a73af63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 25 Nov 2014 19:42:17 -0200 Subject: Use released rails-dom-testing --- actionmailer/actionmailer.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionmailer') diff --git a/actionmailer/actionmailer.gemspec b/actionmailer/actionmailer.gemspec index abc047d339..b63f4e5c08 100644 --- a/actionmailer/actionmailer.gemspec +++ b/actionmailer/actionmailer.gemspec @@ -24,5 +24,5 @@ Gem::Specification.new do |s| s.add_dependency 'activejob', version s.add_dependency 'mail', ['~> 2.5', '>= 2.5.4'] - s.add_dependency 'rails-dom-testing', '~> 1.0', '>= 1.0.4' + s.add_dependency 'rails-dom-testing', '~> 1.0', '>= 1.0.5' end -- cgit v1.2.3 From e2cce6cd4138848bbfbac0ea3e48ee9388f966e1 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Thu, 27 Nov 2014 17:36:15 +0100 Subject: Action Mailer change log pass [skip ci] --- actionmailer/CHANGELOG.md | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md index 9fdda52f77..8d4164ee62 100644 --- a/actionmailer/CHANGELOG.md +++ b/actionmailer/CHANGELOG.md @@ -1,44 +1,42 @@ -* MailerGenerator now generates layouts by default. HTML mailer layout will - include `` and `` tags which will help to reduce spam score in - some spam detection engines. Mailers will now inherit from `ApplicationMailer` +* `MailerGenerator` now generates layouts by default. The HTML mailer layout + now includes `` and `` tags which improve the spam rating in + some spam detection engines. Mailers now inherit from `ApplicationMailer` which sets the default layout. *Andy Jeffries* -* `link_to` and `url_for` generate URLs by default in templates, it is no - longer needed to pass `only_path: false`. +* `link_to` and `url_for` now generate URLs by default in templates. + Passing `only_path: false` is longer needed. Fixes #16497 and #16589. *Xavier Noria*, *Richard Schneeman* -* Attachments can be added while rendering the mail template. +* Attachments can now be added while rendering the mail template. Fixes #16974. *Christian Felder* -* Added `#deliver_later`, `#deliver_now` and deprecate `#deliver` in favour of - `#deliver_now`. `#deliver_later` will enqueue a job to render and deliver - the mail instead of delivering it right at that moment. The job is enqueued - using the new Active Job framework in Rails, and will use whatever queue is - configured for Rails. +* Add `#deliver_later` and `#deliver_now` methods and deprecate `#deliver` in + favor of `#deliver_now`. `#deliver_later` will enqueue a job to render and + deliver the mail instead of delivering it immediately. The job is enqueued + using the new Active Job framework in Rails and will use the queue that you + have configured in Rails. *DHH*, *Abdelkader Boudih*, *Cristian Bica* -* Make `ActionMailer::Previews` methods class methods. Previously they were - instance methods and `ActionMailer` tries to render a message when they - are called. +* `ActionMailer::Previews` are now class methods instead of instance methods. *Cristian Bica* -* Deprecate `*_path` helpers in email views. When used they generate - non-working links and are not the intention of most developers. Instead - we recommend to use `*_url` helper. +* Deprecate `*_path` helpers in email views. They generated broken + links and were not the intention of most developers. The `*_url` + helper is recommended instead. *Richard Schneeman* -* Raise an exception when attachments are added after `mail` was called. +* Raise an exception when attachments are added after `mail` is called. This is a safeguard to prevent invalid emails. Fixes #16163. @@ -47,10 +45,10 @@ * Add `config.action_mailer.show_previews` configuration option. - This config option can be used to enable the mail preview in environments - other than development (such as staging). + This configuration option can be used to enable the mail preview in + environments other than development (such as staging). - Defaults to `true` in development and false elsewhere. + Defaults to `true` in development and `false` elsewhere. *Leonard Garvey* @@ -61,4 +59,5 @@ *Yves Senn* -Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionmailer/CHANGELOG.md) for previous changes. +Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionmailer/CHANGELOG.md) +for previous changes. -- cgit v1.2.3 From e2a01aef4227525eece03a922a3d37f6785376ed Mon Sep 17 00:00:00 2001 From: Zachary Scott Date: Thu, 27 Nov 2014 08:43:37 -0800 Subject: Fix CHANGELOG typo introduced in e2cce6cd [ci skip] --- actionmailer/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionmailer') diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md index 8d4164ee62..968a21ea32 100644 --- a/actionmailer/CHANGELOG.md +++ b/actionmailer/CHANGELOG.md @@ -6,7 +6,7 @@ *Andy Jeffries* * `link_to` and `url_for` now generate URLs by default in templates. - Passing `only_path: false` is longer needed. + Passing `only_path: false` is no longer needed. Fixes #16497 and #16589. -- cgit v1.2.3 From d21d8f903ddd4c655a74909ef4d12fbcdeaa006e Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Thu, 27 Nov 2014 17:46:56 +0100 Subject: Follow-up to e2cce6c [skip ci] --- actionmailer/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md index 968a21ea32..c8b969c59a 100644 --- a/actionmailer/CHANGELOG.md +++ b/actionmailer/CHANGELOG.md @@ -30,8 +30,8 @@ *Cristian Bica* -* Deprecate `*_path` helpers in email views. They generated broken - links and were not the intention of most developers. The `*_url` +* Deprecate `*_path` helpers in email views. They generated broken links in + email views and were not the intention of most developers. The `*_url` helper is recommended instead. *Richard Schneeman* -- cgit v1.2.3 From f25ad07f5ade46eb978fa82658463232d0247c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 28 Nov 2014 15:00:06 -0200 Subject: Start Rails 5 development :tada: We will support only Ruby >= 2.1. But right now we don't accept pull requests with syntax changes to drop support to Ruby 1.9. --- actionmailer/CHANGELOG.md | 64 +-------------------------- actionmailer/lib/action_mailer/gem_version.rb | 6 +-- 2 files changed, 4 insertions(+), 66 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md index c8b969c59a..88b0962e8c 100644 --- a/actionmailer/CHANGELOG.md +++ b/actionmailer/CHANGELOG.md @@ -1,63 +1 @@ -* `MailerGenerator` now generates layouts by default. The HTML mailer layout - now includes `` and `` tags which improve the spam rating in - some spam detection engines. Mailers now inherit from `ApplicationMailer` - which sets the default layout. - - *Andy Jeffries* - -* `link_to` and `url_for` now generate URLs by default in templates. - Passing `only_path: false` is no longer needed. - - Fixes #16497 and #16589. - - *Xavier Noria*, *Richard Schneeman* - -* Attachments can now be added while rendering the mail template. - - Fixes #16974. - - *Christian Felder* - -* Add `#deliver_later` and `#deliver_now` methods and deprecate `#deliver` in - favor of `#deliver_now`. `#deliver_later` will enqueue a job to render and - deliver the mail instead of delivering it immediately. The job is enqueued - using the new Active Job framework in Rails and will use the queue that you - have configured in Rails. - - *DHH*, *Abdelkader Boudih*, *Cristian Bica* - -* `ActionMailer::Previews` are now class methods instead of instance methods. - - *Cristian Bica* - -* Deprecate `*_path` helpers in email views. They generated broken links in - email views and were not the intention of most developers. The `*_url` - helper is recommended instead. - - *Richard Schneeman* - -* Raise an exception when attachments are added after `mail` is called. - This is a safeguard to prevent invalid emails. - - Fixes #16163. - - *Yves Senn* - -* Add `config.action_mailer.show_previews` configuration option. - - This configuration option can be used to enable the mail preview in - environments other than development (such as staging). - - Defaults to `true` in development and `false` elsewhere. - - *Leonard Garvey* - -* Allow preview interceptors to be registered through - `config.action_mailer.preview_interceptors`. - - See #15739. - - *Yves Senn* - -Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionmailer/CHANGELOG.md) -for previous changes. +Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionmailer/CHANGELOG.md) for previous changes. diff --git a/actionmailer/lib/action_mailer/gem_version.rb b/actionmailer/lib/action_mailer/gem_version.rb index e568b8f6f2..ac79788cf0 100644 --- a/actionmailer/lib/action_mailer/gem_version.rb +++ b/actionmailer/lib/action_mailer/gem_version.rb @@ -5,10 +5,10 @@ module ActionMailer end module VERSION - MAJOR = 4 - MINOR = 2 + MAJOR = 5 + MINOR = 0 TINY = 0 - PRE = "beta4" + PRE = "alpha" STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") end -- cgit v1.2.3 From 96d0f751f97c7eebc63d02b5dab88eee3aa3a921 Mon Sep 17 00:00:00 2001 From: claudiob Date: Fri, 28 Nov 2014 18:04:19 -0800 Subject: Bump required Ruby version to 2.1.0 [This article](http://weblog.rubyonrails.org/2014/8/20/Rails-4-2-beta1/#maintenance-consequences-and-rails-5-0) states that: > Rails 5.0 is in most likelihood going to target Ruby 2.2. Before the exact minimum version is fully decided, @arthurnn [suggests](https://github.com/rails/rails/pull/17830#issuecomment-64940383) that **at least** version 2.1.0 **must** be required by the `gemspec` files. --- actionmailer/actionmailer.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionmailer') diff --git a/actionmailer/actionmailer.gemspec b/actionmailer/actionmailer.gemspec index b63f4e5c08..f3bddd8382 100644 --- a/actionmailer/actionmailer.gemspec +++ b/actionmailer/actionmailer.gemspec @@ -7,7 +7,7 @@ Gem::Specification.new do |s| s.summary = 'Email composition, delivery, and receiving framework (part of Rails).' s.description = 'Email on Rails. Compose, deliver, receive, and test emails using the familiar controller/view pattern. First-class support for multipart email and attachments.' - s.required_ruby_version = '>= 1.9.3' + s.required_ruby_version = '>= 2.1.0' s.license = 'MIT' -- cgit v1.2.3 From d1374f99bf3090f3e659687c112ed0c5c0865cfb Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Mon, 27 Oct 2014 17:28:53 +0100 Subject: Pass symbol as an argument instead of a block --- actionmailer/lib/action_mailer/base.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 23139bcbe8..a88e884ee8 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -859,7 +859,7 @@ module ActionMailer when user_content_type.present? user_content_type when m.has_attachments? - if m.attachments.detect { |a| a.inline? } + if m.attachments.detect(&:inline?) ["multipart", "related", params] else ["multipart", "mixed", params] @@ -914,7 +914,7 @@ module ActionMailer if templates.empty? raise ActionView::MissingTemplate.new(paths, name, paths, false, 'mailer') else - templates.uniq { |t| t.formats }.each(&block) + templates.uniq(&:formats).each(&block) end end -- cgit v1.2.3 From c15d3fb0da9e90850a79dc64ebd6614618e35fec Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Sun, 30 Nov 2014 10:18:07 +0900 Subject: [ci skip] fix description of url_for --- actionmailer/lib/action_mailer/base.rb | 5 ----- 1 file changed, 5 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index a88e884ee8..67e316c4fe 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -132,11 +132,6 @@ module ActionMailer # # config.action_mailer.default_url_options = { host: "example.com" } # - # When you decide to set a default :host for your mailers, then you need to make sure to use the - # only_path: false option when using url_for. Since the url_for view helper - # will generate relative URLs by default when a :host option isn't explicitly provided, passing - # only_path: false will ensure that absolute URLs are generated. - # # = Sending mail # # Once a mailer action and template are defined, you can deliver your message or create it and save it -- cgit v1.2.3