Sha256: 681956205cad0e237391780c19995b2369f502656c93ebb07759f896bad26a9c

Contents?: true

Size: 467 Bytes

Versions: 26

Compression:

Stored size: 467 Bytes

Contents

require 'generators/devise/orm_helpers'

module Mongoid
  module Generators
    class DeviseGenerator < Rails::Generators::NamedBase
      include Devise::Generators::OrmHelpers

      def generate_model
        invoke "mongoid:model", [name] unless model_exists? && behavior == :invoke
      end

      def inject_devise_content
        inject_into_file model_path, model_contents, :after => "include Mongoid::Document\n" if model_exists?
      end
    end
  end
end

Version data entries

26 entries across 25 versions & 3 rubygems

Version Path
devise_sociable-0.1.0 vendor/bundle/gems/devise-1.5.4/lib/generators/mongoid/devise_generator.rb
devise_sociable-0.1.0 vendor/bundle/gems/devise-1.2.1/lib/generators/mongoid/devise_generator.rb
devise-1.5.4 lib/generators/mongoid/devise_generator.rb
devise-1.5.3 lib/generators/mongoid/devise_generator.rb
devise-1.5.2 lib/generators/mongoid/devise_generator.rb
devise-1.5.1 lib/generators/mongoid/devise_generator.rb
devise-1.5.0 lib/generators/mongoid/devise_generator.rb
devise-1.5.0.rc1 lib/generators/mongoid/devise_generator.rb
devise-1.4.9 lib/generators/mongoid/devise_generator.rb
devise-1.4.8 lib/generators/mongoid/devise_generator.rb
devise-1.4.7 lib/generators/mongoid/devise_generator.rb
devise-1.4.5 lib/generators/mongoid/devise_generator.rb
devise-1.4.3 lib/generators/mongoid/devise_generator.rb
devise-1.4.2 lib/generators/mongoid/devise_generator.rb
devise-1.4.1 lib/generators/mongoid/devise_generator.rb
devise-1.3.4 lib/generators/mongoid/devise_generator.rb
devise-1.3.3 lib/generators/mongoid/devise_generator.rb
devise-1.3.2 lib/generators/mongoid/devise_generator.rb
devise-1.3.1 lib/generators/mongoid/devise_generator.rb
devise-1.3.0 lib/generators/mongoid/devise_generator.rb