Class: Sequel::Generators::Base

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/rails/generators/sequel.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



14
15
16
# File 'lib/rails/generators/sequel.rb', line 14

def self.source_root
  @source_root ||= File.expand_path(File.join(base_name, generator_name, 'templates'), File.dirname(__FILE__))
end

Instance Method Details

#cpkObject



18
19
20
21
22
# File 'lib/rails/generators/sequel.rb', line 18

def cpk
  if @primary_keys and !@primary_keys.empty? then
    "primary_key([#{@primary_keys.map {|pk| ':' + pk}.join(', ')}])"
  end
end