Permalink
Browse files

updated rake task to work with Rails 2.1 + and ActiveRecord sessions …

…[ David Lee ]
  • Loading branch information...
1 parent 941a869 commit 4b7d48433216e8bb302313aad9d564d4a1a0e4d3 @davidlee davidlee committed Aug 12, 2008
Showing with 7 additions and 5 deletions.
  1. +7 −5 tasks/acts_as_taggable_tasks.rake
View
12 tasks/acts_as_taggable_tasks.rake
@@ -1,19 +1,21 @@
+
namespace :acts_as_taggable do
- require 'rails_generator'
- require 'rails_generator/scripts/generate'
-
namespace :db do
desc "Creates tag tables for use with acts_as_taggable"
task :create => :environment do
+ require 'rails_generator'
+ require 'rails_generator/scripts/generate'
raise "Task unavailable to this database (no migration support)" unless ActiveRecord::Base.connection.supports_migrations?
Rails::Generator::Scripts::Generate.new.run([ "acts_as_taggable_tables", "add_acts_as_taggable_tables" ])
end
end
namespace :stylesheet do
desc "Create tag stylesheet for use with acts_as_taggable"
- task :create do
+ task :create => :environment do
+ require 'rails_generator'
+ require 'rails_generator/scripts/generate'
Rails::Generator::Scripts::Generate.new.run([ "acts_as_taggable_stylesheet" ])
end
end
-end
+end

0 comments on commit 4b7d484

Please sign in to comment.