# What is the state of support for rails 2.2?

**URL:** <https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644>\
**Category:** Engines Development\
**Created:** [November 5, 2008, 11:25pm UTC](https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644 "2008-11-05T23:25:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ned\_Schwartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@Ned\_Schwartz](https://www.ruby-forum.com/u/Ned_Schwartz)\
**Post date:** [November 5, 2008, 11:25pm UTC](https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644/1 "2008-11-05T23:25:24Z")

</div>

Hello,  
I am trying to help get the project Adva-CMS ([http://adva-cms.org/](http://adva-cms.org/)) up  
to  
date and ready for Rails 2.2.

Adva relies heavily on Engines and uses a fork that Sven F. made to  
get  
timestamped migrations to work.

I see that the incompatibility with rails 2.2 has been addressed on the  
edge  
branch on github:

> <https://github.com/lazyatom/engines/commit/499ce3b0480d8fa9375203f5efcadb8cf6ea9efe>

My question is, what state is edge Engines in? and is the timestamped  
migrations issue fixed in edge Engines?

I would like to re-integrate the base Engines repo into Adva-CMS if I  
could,  
but if it is not feasible, I could patch Sven’s fork and keep using  
that.

Please advise

---

<div class="post-metadata">

**Author:** ![Ned\_Schwartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@Ned\_Schwartz](https://www.ruby-forum.com/u/Ned_Schwartz)\
**Post date:** [November 6, 2008, 12:02pm UTC](https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644/2 "2008-11-06T12:02:14Z")

</div>

The simplest way to check the state of edge engines is to check out  
the edge branch and run the tests:

$ git clone git://github.com/lazyatom/engines.git  
$ git checkout edge  
$ rake test RAILS=edge

At the moment, there seems to be an issue with the templating - one of  
the ActionMailer unit tests is failing, and a bunch of functional  
tests are also failing. The functional failures are due to the removal  
of a method we were relying on to determine what was being rendered  
(‘first\_render’). I suspect that these errors might be hiding another  
minor template error.

The branch which contains Samuel W.’ patch for timestamped  
migrations (‘use\_rails\_own\_migration\_mechanism’) isn’t merged with  
edge or master yet, although I expect to merge it soon (potentially  
this afternoon).

If you have any problems running the tests, let me know. Hope that  
helps!

James

---

<div class="post-metadata">

**Author:** ![Ned\_Schwartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@Ned\_Schwartz](https://www.ruby-forum.com/u/Ned_Schwartz)\
**Post date:** [November 6, 2008, 11:01pm UTC](https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644/3 "2008-11-06T23:01:18Z")

</div>

well… I get one unit test error and 6 functional errors.  
The unit test error is is in ./test/unit/action\_mailer\_test.rb:34:in

`test\_should\_be\_able\_to\_create\_mails\_from\_plugin’

> 

> ActionView::MissingTemplate: Missing template  
> plugin\_mail/mail\_from\_plugin.erb

The functional test errors are all the same:

ActionView::TemplateError: undefined method `first\_render’ for

> #ActionView::Base:0x236b670

Here is a pastie of the full test results [http://pastie.org/309061](http://pastie.org/309061)

If anyone has any idea about these that would be great… in the mean  
time,  
I have been trying to track them down.

Thanks all,

Ned

---

<div class="post-metadata">

**Author:** ![Ned\_Schwartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@Ned\_Schwartz](https://www.ruby-forum.com/u/Ned_Schwartz)\
**Post date:** [November 7, 2008, 10:18pm UTC](https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644/4 "2008-11-07T22:18:00Z")

</div>

I have a question… the first  
error, `test\_should\_be\_able\_to\_create\_mails\_from\_plugin’, seems to be  
cause  
by there being a missing template in  
/test/plugins/test\_plugin\_mailing/app/views/plugin\_mail/.  
the error is:  
ActionView::MissingTemplate: Missing template  
plugin\_mail/mail\_from\_plugin.erb in view path

What confuses me, is that there is a  
standard mail\_from\_plugin.text.plain.erb template.

I copied this template into a file called mail\_from\_plugin.html.erb and  
the  
same test passed.

Does anyone have any idea why this is? Also I am not sure if there is a  
reason that just the plain text template is in there and not the  
html.erb  
template. Is this test testing particularly for the plain text template?

Ned

---

<div class="post-metadata">

**Author:** ![Ned\_Schwartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@Ned\_Schwartz](https://www.ruby-forum.com/u/Ned_Schwartz)\
**Post date:** [November 7, 2008, 10:40pm UTC](https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644/5 "2008-11-07T22:40:52Z")

</div>

The second series of errors were all related to #first\_render being  
removed  
from ActionView::Base.  
i noticed a ticket was opened in lighthouse about this so I responded  
there:  
[http://engines.lighthouseapp.com/projects/10178-engines-plugin/tickets/41-view-tests-shouldnt-rely-on-first\_render#ticket-41-2](http://engines.lighthouseapp.com/projects/10178-engines-plugin/tickets/41-view-tests-shouldnt-rely-on-first_render#ticket-41-2)

however, I thought I would continue this conversation here as well.

Hi, I tried globally changing the \<%= self.first\_render %\> to \<%=  
self.instance\_variable\_get(:@\_first\_render) %\>

this seems to work pushing the errors to failures:

\<“namespace/app\_and\_plugin/a\_view (from app)”\> expected but was  
\<“namespace/app\_and\_plugin/a\_view.html.erb (from app)”\>

etc.

This seems acceptable if the test condition was just changed from  
assert\_response\_body ‘alpha\_plugin/a\_view’ to assert\_response\_body  
‘alpha\_plugin/a\_view.html.erb’

would that still satisfy the test? are the file extensions a problem?

---

<div class="post-metadata">

**Author:** ![Ned\_Schwartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@Ned\_Schwartz](https://www.ruby-forum.com/u/Ned_Schwartz)\
**Post date:** [November 9, 2008, 5:06pm UTC](https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644/6 "2008-11-09T17:06:05Z")

</div>

The test was testing the ‘default’ behaviour, but the template  
overspecified that the email should be text/plain. The simplest way to  
‘fix’ this test was to just rename the default template to ‘.erb’,  
rather than ‘.text.plain.erb’, as this seems to be how Rails 2.2  
expects ActionMailer to be used.

So… we’re now passing all tests against Edge Rails! In other words,  
the engines plugin should now be compatible with Rails 2.2 (seems like  
it always was, but the tests were a bit 2.1-specific).

Thanks again for your investigations here,

James

---

<div class="post-metadata">

**Author:** ![Ned\_Schwartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@Ned\_Schwartz](https://www.ruby-forum.com/u/Ned_Schwartz)\
**Post date:** [November 9, 2008, 4:54pm UTC](https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644/7 "2008-11-09T16:54:55Z")

</div>

I just resolved this bug, by implementing a specific mechanism for  
determining the path of the template that was rendered. This is  
cleaner than relying on ActionView’s internal state, and should  
hopefully be more future-proof!

Now to track down that action mailer issue…

Thanks for your help with this!

James

---

<div class="post-metadata">

**Author:** ![Ned\_Schwartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@Ned\_Schwartz](https://www.ruby-forum.com/u/Ned_Schwartz)\
**Post date:** [November 10, 2008, 10:38am UTC](https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644/8 "2008-11-10T10:38:03Z")

</div>

Great news - thanks for this James, Ned, et al 🙂

2008/11/9 James A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Ned\_Schwartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@Ned\_Schwartz](https://www.ruby-forum.com/u/Ned_Schwartz)\
**Post date:** [November 10, 2008, 12:06am UTC](https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644/9 "2008-11-10T00:06:16Z")

</div>

Awesome! Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Ned\_Schwartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@Ned\_Schwartz](https://www.ruby-forum.com/u/Ned_Schwartz)\
**Post date:** [November 10, 2008, 3:47pm UTC](https://www.ruby-forum.com/t/what-is-the-state-of-support-for-rails-2-2/152644/10 "2008-11-10T15:47:04Z")

</div>

Wow!  
This is really great news to wake up to first thing on monday! Great  
news  
and well done!

Ned
