Skip to content

Conversation

akxcv
Copy link

@akxcv akxcv commented Mar 3, 2017

Sequel::Generators::Base.source_root method does not take a path argument, which diverges from Rails::Generators::Base API. The path argument is very useful for creating custom generators with templates, for example:

# lib/generators/foo/install/install_generator.rb
class Foo::Generators::InstallGenerator < ::Sequel::Generators::Base
  include Sequel::Generators::Migration
  source_root File.expand_path('../templates', __FILE__) # will not work, but would work with Rails
  # ...
end

# templates are stored in lib/generators/foo/install/templates

This behaviour can be observed since Rails 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant