Sha256: 7391122ed80e15941251d5309689a7a1d21fb8c85897f7fc5212e770fbe734b5
Contents?: true
Size: 573 Bytes
Versions: 60
Compression:
Stored size: 573 Bytes
Contents
module Hobo class ResourceGenerator < Rails::Generators::NamedBase argument :attributes, :type => :array, :default => [], :banner => "field:type field:type" class_option :timestamps, :type => :boolean def generate_hobo_controller invoke 'hobo:controller', [name.pluralize], options end def generate_hobo_model # is there any better way to pass attributes? attr = attributes.map{|a| "#{a.name}:#{a.type}"} invoke 'hobo:model', [name, attr], options end end end
Version data entries
60 entries across 60 versions & 1 rubygems