Wednesday, December 3, 2008

custom assert_select_rjs matcher

Background:
I wanted to test rjs redirection:


Problem:
ActionController::Assertions::SelectorAssertions#assert_select_rjs don't know about :redirect_to

Solution:
I don't know if this is the right solution but I added this at the end of my test_helper.rb then I can assert by :redirect_to now


Tuesday, November 18, 2008

Application Controller

The file application.rb had just been officially renamed to application_controller.rb; and the special case in the code for checking it removed. I'm not even OC but this was also bothering me since I used rails.

The commit: fcce1f1

Thursday, October 30, 2008

reverse_sql_order

I just found this while browsing through AR Base's source code. It seems very useful.

Wednesday, October 29, 2008

"Only get, head, post, put, and delete requests are allowed." Ruby on Rails error

Only get, head, post, put, and delete requests are allowed.
If you get this while/after editing your routes, then you'll need to restart your local server. Thanks to this guy.

Friday, October 24, 2008

Using custom column type in Rails migrations

It seems if the type you gave to a column definition in a migration is not listed in native_database_types, Rails will just use what you gave it.

Therefore this will work:

Wednesday, October 8, 2008

Obi-Wan vs Yoda

I just realized this the other night while watching The Amazing Race though it seems to have been talked about since Episode 3 was released.

Obi-Wan:
Only a Sith deal in absolutes

Yoda:
Do, or do not. There is no try.


Friday, September 12, 2008

Rubyforge gem problem

Problem:

starting the server and you get:
 can't activate rubyforge (= 0.4.5), already activated rubyforge-1.0.0] (Gem::Exception)

Solution:
remove old versions of rubyforge gem
jorrel@helen ~ $ sudo gem uninstall rubyforge

Select gem to uninstall:
1. rubyforge-0.4.4
2. rubyforge-0.4.5
3. rubyforge-1.0.0
4. All versions
> 1
Successfully uninstalled rubyforge-0.4.4
jorrel@helen ~ $ sudo gem uninstall rubyforge

Select gem to uninstall:
1. rubyforge-0.4.5
2. rubyforge-1.0.0
3. All versions
> 1
Successfully uninstalled rubyforge-0.4.5
jorrel@helen ~ $ gem list | grep rubyforge
rubyforge (1.0.0)