Sha256: 8ccb0d15b83cdea23681958e479fa76612310bea77c49f8cbc0271c260bd761c

Contents?: true

Size: 745 Bytes

Versions: 15

Compression:

Stored size: 745 Bytes

Contents

module Devise
  module Generators
    class DeviseGenerator < Rails::Generators::NamedBase
      namespace "devise"
      source_root File.expand_path("../templates", __FILE__)

      desc "Generates a model with the given NAME (if one does not exist) with devise " <<
           "configuration plus a migration file and devise routes."

      hook_for :orm

      class_option :routes, :desc => "Generate routes", :type => :boolean, :default => true

      def add_devise_routes
        devise_route  = "devise_for :#{plural_name}"
        devise_route << %Q(, :class_name => "#{class_name}") if class_name.include?("::")
        devise_route << %Q(, :skip => :all) unless options.routes?
        route devise_route
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
devise_sociable-0.1.0 vendor/bundle/gems/devise-1.5.4/lib/generators/devise/devise_generator.rb
devise-1.5.4 lib/generators/devise/devise_generator.rb
devise-2.0.1 lib/generators/devise/devise_generator.rb
devise-2.0.0 lib/generators/devise/devise_generator.rb
devise-2.0.0.rc2 lib/generators/devise/devise_generator.rb
devise-2.0.0.rc lib/generators/devise/devise_generator.rb
devise-1.5.3 lib/generators/devise/devise_generator.rb
cloudfoundry-devise-1.5.2 lib/generators/devise/devise_generator.rb
devise-1.5.2 lib/generators/devise/devise_generator.rb
devise-1.5.1 lib/generators/devise/devise_generator.rb
devise-1.5.0 lib/generators/devise/devise_generator.rb
devise-1.5.0.rc1 lib/generators/devise/devise_generator.rb
devise-1.4.9 lib/generators/devise/devise_generator.rb
devise-1.4.8 lib/generators/devise/devise_generator.rb
devise-1.4.7 lib/generators/devise/devise_generator.rb