Sha256: 918297dcf5843a5534974eecf9de821df89cd9ea5f25506a5ea9c097d86e8afd

Contents?: true

Size: 483 Bytes

Versions: 4

Compression:

Stored size: 483 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.exist?(path)
      end

      hook_for :orm
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/devise_invitable-2.0.9/lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-2.0.9 lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-2.0.8 lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-2.0.7 lib/generators/devise_invitable/devise_invitable_generator.rb