I’ve got the login_engine plugin installed which has a fixtures for
‘users’.
When I load ‘rake load_fixtures’, it doesn’t seem to load the
login_engine’s fixtures into the development database.
Should it? Or should it be another rake task? (i.e. rake
load_plugin_fixtures)
Joe
On 11/23/05, Joe Van D. [email protected] wrote:
I’ve got the login_engine plugin installed which has a fixtures for ‘users’.
When I load ‘rake load_fixtures’, it doesn’t seem to load the
login_engine’s fixtures into the development database.
Should it? Or should it be another rake task? (i.e. rake load_plugin_fixtures)
Joe
In any event, here’s the additional rake task that will load all
plugin fixtures:
desc “Load plugin fixtures into the current environment’s database”
task :load_plugin_fixtures => :environment do
require ‘active_record/fixtures’
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
Dir.glob(File.join(RAILS_ROOT, ‘vendor’, ‘plugins’, ‘', ‘test’,
‘fixtures’, '.yml’)).each do |fixture_file|
Fixtures.create_fixtures(File.dirname(fixture_file),
File.basename(fixture_file, ‘.*’))
end
end
Joe
Since engines are a special-case plugin ‘type’, it’s unlikely that the
default rake tasks would support them. However, I can see it being a
bit of a grey area, since testing plugins is supported.
Regardless - I’ll add this task to the Engine plugin so it is
available to everyone using engines, thanks Joe
On 11/24/05, James A. [email protected] wrote:
Since engines are a special-case plugin ‘type’, it’s unlikely that the
default rake tasks would support them. However, I can see it being a
bit of a grey area, since testing plugins is supported.
Regardless - I’ll add this task to the Engine plugin so it is
available to everyone using engines, thanks Joe
I think that task should work for all plugins that have fixtures,
engines or no.