userswitch 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 184a9cc1b6769fb8ee1f8ba31ba5d362f7461c76
4
- data.tar.gz: 9540437d90dd855ed4d048a9f72fd6b94ac1e1a4
3
+ metadata.gz: eb48cdccbf96a8c5c0e6d32c51a8820c8df1ea41
4
+ data.tar.gz: 8a92b643448e16d8ec018d6bce0add911ba362ed
5
5
  SHA512:
6
- metadata.gz: e32ca82ba5c4e93681502ce9c39597263ab84cb3ff2ac3478cdcbf519bad762a1a94a10861617611cbf242f655c98d57c3b94791a030928773be79a181d3df40
7
- data.tar.gz: 4b552be4ffbd8752f28355ede7ecbf17bbe303821514c55cc9a7bd64fc634d64f03a2f8f73e44e0a8086b04b7e6c9af307100470fac639b3b37ec6542ad55cba
6
+ metadata.gz: 993f84bf0063b71a85347bcf9f7bb23401dea1f999e55ef7162bf756c330e23669c9900c3a15b87e79ed3eaa1bdfac35fdd1fabfeab2847e8cbb5bf2d21b9ed1
7
+ data.tar.gz: 7518c52bcffbce1b77a88e358fcd13063829236d9eae118b4f3fb894c09a6dda5eea12bfcb35e3ff2150b85998f4cd5e1be54e9d45b47bb7c7611b56c5fadcb6
@@ -1,6 +1,7 @@
1
1
  module Userswitch
2
2
  class SwitchController < ApplicationController
3
3
  include Devise::Controllers::Helpers
4
+ before_action :authenticate_user!, except: [:switch_user]
4
5
 
5
6
  def switch_user
6
7
  sign_in(params[:role].constantize.find(params[:id]))
@@ -1,3 +1,3 @@
1
1
  module Userswitch
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
data/lib/userswitch.rb CHANGED
@@ -56,7 +56,7 @@ module Userswitch
56
56
  end
57
57
 
58
58
  def users(current_user)
59
- create_button_from_user(current_user.id).html_safe
59
+ create_button_from_user(current_user.try(:id)).html_safe
60
60
  end
61
61
 
62
62
  module_function :users,
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: userswitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - matija
@@ -81,6 +81,7 @@ files:
81
81
  - us2.png
82
82
  - us3.png
83
83
  - userswitch-0.1.2.gem
84
+ - userswitch-0.1.5.gem
84
85
  - userswitch.gemspec
85
86
  homepage: https://github.com/kodius/userswitch
86
87
  licenses: