Sha256: e4bb441a61052c20cdb4c4d2437d5f6392a80d5e1cf2124bee55bd2786b5e4d3
Contents?: true
Size: 690 Bytes
Versions: 7
Compression:
Stored size: 690 Bytes
Contents
module Ninsho module Generators class NinshoGenerator < Rails::Generators::NamedBase include Rails::Generators::ResourceHelpers namespace "ninsho" desc "Creates a model with the given name with ninsho" << "includes migration files, and routes config" hook_for :orm class_option :routes, :desc => "Generate routes", :type => :boolean, :default => true def add_ninsho_routes ninsho_routes = "ninsho_on :#{plural_name}" ninsho_routes << %Q(, :class_name => "#{class_name}") if class_name.include?("::") ninsho_routes << %Q(, :skip => :all) unless options.routes? route ninsho_routes end end end end
Version data entries
7 entries across 7 versions & 1 rubygems