Sha256: 73aebcc46f6509ae557c7d33f39868050d8f4c7a0d6dce2a7c9ddec08022c395

Contents?: true

Size: 487 Bytes

Versions: 6

Compression:

Stored size: 487 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

6 entries across 6 versions & 3 rubygems

Version Path
devise_invitable-0.3.7 lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-0.3.6 lib/generators/devise_invitable/devise_invitable_generator.rb
dougjohnston-devise_invitable-0.4.rc lib/generators/devise_invitable/devise_invitable_generator.rb
aihs_devise_invitable-0.4.rc lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-0.3.5 lib/generators/devise_invitable/devise_invitable_generator.rb
devise_invitable-0.3.4 lib/generators/devise_invitable/devise_invitable_generator.rb