Sha256: f161f632518e2e6f221bcf0816782ed0f187e3d47aca190c8476dfad2e5ac44a
Contents?: true
Size: 772 Bytes
Versions: 13
Compression:
Stored size: 772 Bytes
Contents
require "generators/sequel" module Sequel module Generators class ModelGenerator < Base argument :attributes, :type => :array, :default => [], :banner => "field:type field:type" check_class_collision class_option :migration, :type => :boolean class_option :timestamps, :type => :boolean class_option :parent, :type => :string, :desc => "The parent class for the generated model" def create_migration_file return unless options[:migration] migration_template "migration.rb.erb", "db/migrate/create_#{table_name}.rb" end def create_model_file template 'model.rb.erb', File.join('app/models', class_path, "#{file_name}.rb") end hook_for :test_framework end end end
Version data entries
13 entries across 13 versions & 1 rubygems