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 |