pretender 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7cf9079c429f9aa0c9eb9f298f6c26ca15e983cc
4
- data.tar.gz: 79f8b2328f1ec9ea662ee1feb112db4b1bd8d57d
3
+ metadata.gz: 60e5acb138e7418d36f5db31434a5804ccd72230
4
+ data.tar.gz: 9d87f62ab46dd07471752f82d0a323f585c6ffda
5
5
  SHA512:
6
- metadata.gz: b7e6895927961d7cfed49fdc450b0c3102425fbfbf027ae4b6cb12bd3e29eb134399e452d2974d52925146505ec589a74ef5d0beea4719fb1d301424de216c12
7
- data.tar.gz: e6695c73ed14d15359114f0a779b77bb186e299a18bf679f5774921e66759c57a6852c3bf4f59b56dfab75e9a5e3c32a3dde543987b868df247dc29cdb20f3da
6
+ metadata.gz: f1f77c7fb923d3ae2f896ac1d366ef3dcb8d0dc568aaa09ce1fd6dd5fa31ad3cde50f5e9df2712a2b7179483b316d5183b3ff0c32bd1876408a29da5409b82b1
7
+ data.tar.gz: 1cbd2fe07379ed8f205d6d71e2ccd38fddd90b0766e8a266cccca25660f030652e2cd8ea1cfd5b1f2915e9032ec6e9e6d208b5a08d9f79764dddb6bb296a57ab
@@ -1,3 +1,7 @@
1
+ ## 0.2.1
2
+
3
+ - Better error message
4
+
1
5
  ## 0.2.0
2
6
 
3
7
  - Started changelog
data/README.md CHANGED
@@ -30,8 +30,6 @@ class ApplicationController < ActionController::Base
30
30
  end
31
31
  ```
32
32
 
33
- If `current_user` is defined in your `ApplicationController`, it must come **before** the `impersonates` method.
34
-
35
33
  ## How It Works
36
34
 
37
35
  Sign in as another user with:
@@ -16,7 +16,7 @@ module Pretender
16
16
  alias_method true_method, impersonated_method
17
17
  else
18
18
  define_method true_method do
19
- raise Pretender::Error, "Cannot find method: #{impersonated_method}" unless ActionController::Base.method_defined?(impersonated_method)
19
+ raise Pretender::Error, "#{impersonated_method} must be defined before the impersonates method" unless ActionController::Base.method_defined?(impersonated_method)
20
20
  ActionController::Base.instance_method(impersonated_method).bind(self).call
21
21
  end
22
22
  end
@@ -1,3 +1,3 @@
1
1
  module Pretender
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretender
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane