Fixed bug with user_type set to false

Andrew Kane committed May 11, 2014
commit aaa7557ffa1009b93d47b00632bdb0dfa76019d2
Showing 2 changed files with 5 additions and 1 deletions
CHANGELOG.md +4 -0
@@ @@ -1,3 +1,7 @@
+ ## 0.1.8 [unreleased]
+
+ - Fixed bug with `user_type` set to `false` instead of `nil`
+
## 0.1.7
- Made cookie functions public for ahoy_events
ahoy_matey.rb b/lib/ahoy_matey.rb +1 -1
@@ @@ -40,7 +40,7 @@ module Ahoy
mattr_accessor :user_method
self.user_method = proc do |controller|
- (controller.respond_to?(:current_user) && controller.current_user) || (controller.respond_to?(:current_resource_owner, true) and controller.send(:current_resource_owner))
+ (controller.respond_to?(:current_user) && controller.current_user) || (controller.respond_to?(:current_resource_owner, true) && controller.send(:current_resource_owner)) || nil
end
end