Sha256: 18441d9edcaabbbc81967f9954dd3d09045477bf9e0ae32b3ebb1221483cfca3
Contents?: true
Size: 527 Bytes
Versions: 46
Compression:
Stored size: 527 Bytes
Contents
module PushType class NodeGenerator < Rails::Generators::NamedBase source_root File.expand_path('../templates', __FILE__) argument :attributes, type: :array, default: [], banner: "field:type field:type" def create_model template 'node.rb', "app/models/#{ file_name }.rb" template 'node.html.erb', "app/views/nodes/#{ file_name }.html.erb" end hook_for :test_framework, as: :model protected def attribute_as_field(att) "field :#{ att.name }, :#{ att.type }" end end end
Version data entries
46 entries across 46 versions & 1 rubygems