Sha256: c07da5de51aa37d33b05ade32f2afc7742c91c5e88d4f1af79cb3f1616435afa
Contents?: true
Size: 764 Bytes
Versions: 8
Compression:
Stored size: 764 Bytes
Contents
class RioModelGenerator < Rails::Generator::NamedBase def manifest if (@args.size == 0) begin attributes = class_name.constantize.column_names - ["id", "created_at", "updated_at"] rescue attributes = [] end else attributes = @args.map {|arg| arg.match(/(.*):.*/)[1] } end record do |m| m.template "model.js", "public/javascripts/models/#{file_name}.js", :assigns => { :attributes => attributes } m.directory "public/javascripts/specs/fixtures/models" m.template "fixture.js", "public/javascripts/specs/fixtures/models/#{file_name}.js" m.directory "public/javascripts/specs/models" m.template "spec.js", "public/javascripts/specs/models/#{file_name}_spec.js" end end end
Version data entries
8 entries across 8 versions & 1 rubygems