public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Changed mailer generator to not use instance variables.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Mislav Marohnić (author)
Fri Apr 18 15:13:15 -0700 2008
josh (committer)
Fri Apr 18 15:13:15 -0700 2008
commit  36eecda8d0b5ebd3341692868b8faeec8fbce9d0
tree    01d6483c8d56fe6a48e98c4d072dd0b08d3e66bf
parent  dfdb9f738e9842752c340634622624544efe18c1
...
2
3
4
5
6
7
8
9
10
 
 
 
 
 
 
11
12
13
...
2
3
4
 
 
 
 
 
 
5
6
7
8
9
10
11
12
13
0
@@ -2,12 +2,12 @@ class <%= class_name %> < ActionMailer::Base
0
 <% for action in actions -%>
0
 
0
   def <%= action %>(sent_at = Time.now)
0
-    @subject    = '<%= class_name %>#<%= action %>'
0
-    @body       = {}
0
-    @recipients = ''
0
-    @from       = ''
0
-    @sent_on    = sent_at
0
-    @headers    = {}
0
+    subject    '<%= class_name %>#<%= action %>'
0
+    recipients ''
0
+    from       ''
0
+    sent_on    sent_at
0
+    
0
+    body       :action => '<%= action %>'
0
   end
0
 <% end -%>
0
 end
...
8
9
10
11
12
13
14
15
16
 
 
 
 
 
 
17
18
19
...
8
9
10
 
 
 
 
 
 
11
12
13
14
15
16
17
18
19
0
@@ -8,12 +8,12 @@ class RailsMailerGeneratorTest < GeneratorTestCase
0
     assert_generated_model_for :notifier, 'ActionMailer::Base' do |model|
0
       assert_has_method model, :reset_password do |name, body|
0
         assert_equal [
0
-            "@subject    = 'Notifier#reset_password'",
0
-            "@body       = {}",
0
-            "@recipients = ''",
0
-            "@from       = ''",
0
-            "@sent_on    = sent_at",
0
-            "@headers    = {}"
0
+            "subject    'Notifier#reset_password'",
0
+            "recipients ''",
0
+            "from       ''",
0
+            "sent_on    sent_at",
0
+            "",
0
+            "body       :action => 'reset_password'"
0
           ],
0
           body.split("\n").map{|line| line.sub(' '*4, '') }
0
       end

Comments