module Refinery
  class <%= extension_plural_class_name %>Generator < Rails::Generators::Base

    def rake_db
      rake("refinery_<%= extension_plural_name %>:install:migrations")
    end

    def append_load_seed_data
      create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
      append_file 'db/seeds.rb', :verbose => true do
        <<-EOH

# Added by Refinery CMS <%= plural_name.titleize %> extension
Refinery::<%= namespacing %>::Engine.load_seed
        EOH
      end
    end
  end
end

module Refinery
  class <%= extension_plural_class_name %>Generator < Rails::Generators::Base

    def rake_db
      rake("refinery_<%= extension_plural_name %>:install:migrations")
    end

    def append_load_seed_data
      create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
      append_file 'db/seeds.rb', :verbose => true do
        <<-EOH

# Added by Refinery CMS <%= namespacing %> extension
Refinery::<%= namespacing %>::Engine.load_seed
        EOH
      end
    end
  end
end

Use namespace instead of extension resource plural name, which is often wrong in the case of nested resources.
Use namespace instead of extension resource plural name, which is often wrong in the case of nested resources.

Fixes #2016
