Patches: Browse | Submit New | Admin

[#26755] Fixes support for STI and broken-ness when used against Rails 2.3.x or greater.

Date:
2009-07-26 00:58
Priority:
3
Submitted By:
Juris Galang (jurisgalang)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Fixes support for STI and broken-ness when used against Rails 2.3.x or greater.

Detailed description
Prior to Rails 2.3.x ApplicationController was in application.rb, it is now application_controller.rb

This patch also will allow railroad to correctly recognize STI models.
Also,  updated ChangeLog file.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-08-26 13:39
Sender: Marcello Barnaba

Hi Juris,

blindly replacing "application.rb" with
"application_controller.rb" would break Railroad on
Rails < 2.3.

What about deciding which file name to use by looking at the
return value of the `Rails.version` helper?

Something like this:

files << 'app/controllers/application.rb' if Rails.version.to_f
< 2.3

in the third hunk of your patch (controllers_diagram.rb:23);
without adding explicitly for Rails >= 2.3, because the previous
Dir.glob would already put the file into the array ;), and:

require 'app/controllers/application' + ('_controller' if
Rails.version.to_f >= 2.3).to_s + '.rb'

in the fourth one (same file, line 39)

What do you think? Care to provide an updated patch? :)

Thanks!

~Marcello

Attached Files:

Name Description Download
railroad-0.5.0-patched.patch Fixes support for STI and broken-ness when used against Rails 2.3.x or greater Download

Changes:

Field Old Value Date By
File Added4635: railroad-0.5.0-patched.patch2009-07-26 01:31jurisgalang