Sha256: 09dafd6a90165476dc68c8569663c703bb7d2d825a86df5b54fcac420331b9f2

Contents?: true

Size: 484 Bytes

Versions: 7

Compression:

Stored size: 484 Bytes

Contents

module DeviseInvitable
  module Generators
    class DeviseInvitableGenerator < Rails::Generators::NamedBase
      namespace 'devise_invitable'

      desc 'Add :invitable directive in the given model. Also generate migration for ActiveRecord'

      def inject_devise_invitable_content
        path = File.join('app', 'models', "#{file_path}.rb")
        inject_into_file(path, 'invitable, :', after: 'devise :') if File.exists?(path)
      end

      hook_for :orm
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
devise_invitable-2.0.6 lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-2.0.5 lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-2.0.4 lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-2.0.3 lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-2.0.2 lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-2.0.1 lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-2.0.0 lib/generators/devise_invitable/devise_invitable_generator.rb