Hi there,
after upgrading from rails 3.0.0.beta4 to rails 3.0.0.rc today I
noticed that I got some errors while booting the rails app. It seems
that a new functionality was added (the FileUpdateChecker) to check if
either the routing or I18n files are changed.
It does that by stat-ing the files in a path array it receives (please
see
http://groups.google.com/group/rubyonrails-core/browse_thread/thread/b7955fe0d26afc6d
which is a thread that I started in the rails core group).
It turns out that the array constists of strings, but when the
i18n_routing plugin kicks in, it appends an additional string inside
the main string, containing some additional path information.
This happens around line 150 of the i18n_routing_rails3.rb file which
states;
I18n.load_path = (I18n.load_path << Dir[Rails.root.join('config',
'locales', '*.yml').to_s]).uniq
This results in an array within an array which finaly breaks the
file_update_checker file on line 25;
paths.map { |path| File.stat(path).mtime }.max
I changed the source of your plugin a bit to flatten out the array
before making it unqiue like this;
I18n.load_path = (I18n.load_path << Dir[Rails.root.join('config',
'locales', '*.yml')]).flatten.uniq
This makes all the errors go away. Could you please check if this
solution is solid enough and update the plugin? That would be awesome!
Thanks,
Stijn