Sha256: 82d206ac11f2c2fd02eb40fae03398d5403de79853b38ce7578b27ff061f59a7
Contents?: true
Size: 789 Bytes
Versions: 11
Compression:
Stored size: 789 Bytes
Contents
require 'model_base' require 'rails/generators' module ModelBase module Generators module ModelSupport def self.included(klass) klass.send :include, ::Rails::Generators::ResourceHelpers end def initialize(args, *options) super(args, *options) @model_name = (class_path + [@name.singularize.camelize]).join('::') unless @model_name @model_name = @model_name.camelize end protected def model @model ||= ModelBase::MetaModel.new(@model_name) end def controller_routing_path ActiveModel::Naming.route_key(@model_name.constantize) end def singular_controller_routing_path ActiveModel::Naming.singular_route_key(@model_name.constantize) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems