Sha256: 4d08c8fe23d653f4771b3767b011593e15a915fa520cbfe247eee50046dff656

Contents?: true

Size: 684 Bytes

Versions: 24

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true

module RailsAppGenerator
  # Custom add-ons for RailsAppGenerator
  module AddOns
    # Add Pretender to rails application
    class Pretender < RailsAppGenerator::Addon
      required_gem gem.version('pretender', '0.4.0', 'Log in as another user in Rails')

      def apply
        copy_file('app/controllers/pretender_controller.rb', 'app/controllers/pretender_controller.rb')

        route("post 'pretender/:user_id/impersonate' , to: 'pretender#impersonate'        , :as => :impersonate_user")
        route("post 'pretender/stop_impersonating'   , to: 'pretender#stop_impersonating' , :as => :stop_impersonating_user")
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rails_app_generator-0.3.6 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.3.5 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.3.4 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.3.3 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.3.2 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.3.1 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.3.0 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.43 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.42 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.41 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.40 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.39 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.38 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.37 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.36 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.35 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.34 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.33 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.32 lib/rails_app_generator/addons/pretender.rb
rails_app_generator-0.2.31 lib/rails_app_generator/addons/pretender.rb