Rails dependencies introduced in rubigen >1.5.0
Reported by Aitor García Rey | January 20th, 2009 @ 11:05 PM
Generate a RubiGen::Base based application generator:
newgem foobar
script/generate application_generator foobar
add this to the manifest method on foobar_generator.rb to test the migration generation process:
m.migration_template 'test.rb', 'db/migrate',:migration_file_name => 'test'
and add a simple migration template:
class Test < ActiveRecord::Migration
def self.up
end
def self.down
end
end
Then try to use this generator:
chmod +x bin/foobar
bin/foobar test_app
This throws an "uninitialized constant":
uninitialized constant RubiGen::Commands::Base::ActiveRecord
I think this error is related to Rails dependencies no satisfied in [RUBIGEN_PATH]/lib/rubigen/commands.rb line 65:
Dir.glob("#{RAILS_ROOT}/#{@migration_directory}/[0-9]*_*.rb").inject(0) do |max, file_path|
and line 88:
if ActiveRecord::Base.timestamped_migrations
As workaround a simple require 'active_record' would fix it. Obviously this Rails dependencies could be not desired and a few changes in the rubigen gem will remove this dependency.
Let me know if a you a few test to clarify this issue.
Comments and changes to this ticket
-
Dr Nic January 20th, 2009 @ 11:15 PM
Sweet, thanks for the summary of the bug. I'll look in to it soon.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
A generator system extracted from Rails
