Sha256: 92a4aa264b9cc7970495ceb58378cef0544ef8d600ec15d6ea1332f132ab90be
Contents?: true
Size: 764 Bytes
Versions: 12
Compression:
Stored size: 764 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", "db/migrate/create_#{table_name}.rb" end def create_model_file template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb") end hook_for :test_framework end end end
Version data entries
12 entries across 12 versions & 2 rubygems