diff options
author | Mark Longair <mhl@pobox.com> | 2013-11-29 07:38:53 +0000 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2013-11-29 12:27:18 +0000 |
commit | 6c4bf2ee10fca5030810a16c5b5b7c2a9b65dc9a (patch) | |
tree | 65f7770b99c038d26ddebecc89bdaef4d8887634 | |
parent | 47f070d5732fa90edcc92b018709f1e3c5ca6e99 (diff) |
Update the acts_as_xapian generator to work under Rails 3
-rw-r--r-- | lib/generators/acts_as_xapian/acts_as_xapian_generator.rb | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/generators/acts_as_xapian/acts_as_xapian_generator.rb b/lib/generators/acts_as_xapian/acts_as_xapian_generator.rb index a1cd1801d..434c02cb5 100644 --- a/lib/generators/acts_as_xapian/acts_as_xapian_generator.rb +++ b/lib/generators/acts_as_xapian/acts_as_xapian_generator.rb @@ -1,13 +1,10 @@ -class ActsAsXapianGenerator < Rails::Generator::Base - def manifest - record do |m| - m.migration_template 'migration.rb', 'db/migrate', - :migration_file_name => "create_acts_as_xapian" - end +require 'rails/generators/active_record/migration' + +class ActsAsXapianGenerator < Rails::Generators::Base + include Rails::Generators::Migration + extend ActiveRecord::Generators::Migration + source_root File.expand_path("../templates", __FILE__) + def create_migration_file + migration_template "migration.rb", "db/migrate/add_acts_as_xapian_jobs.rb" end - - protected - def banner - "Usage: #{$0} acts_as_xapian" - end end |