Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (15 sloc) 564 Bytes
require 'rails/generators/active_record'
require 'rails/generators/active_record/migration/migration_generator'
require 'roo/base'
module Roo
module Generators
class NewModelGenerator < Roo::Generators::Base
hook_for :orm, :as => :model
source_root(File.join(File.dirname(__FILE__), "templates"))
class_option :validation, :type => :boolean
def create_migration_file
create_file File.join('app', 'models', class_path, file_name) + "_validation.rb", "module #{class_name}Validation; end"
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.