panda_pal 5.9.10 → 5.9.11

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
  SHA256:
3
- metadata.gz: ea44e4396fe54b0b43f503f36739c98b4233d0985dd990225dc538d6d606c6b2
4
- data.tar.gz: 7323abf71ed670167cb312728c335889236a3c4f852b78857a164459c77006a9
3
+ metadata.gz: 7c75994a45a1847fd90718c94cd9ddb089f2d34d30fd3bc88f30c68cdaa3c104
4
+ data.tar.gz: ecd5df18b57808c26031538eac7be097b8c35a711a11fd37be482e6bc0c18747
5
5
  SHA512:
6
- metadata.gz: b8b8ef390606b9dd7e954d67fe943a431b51252d8e3e565a5cf166528108e4776d0311c59a943347a2e552518ad58e13dc0e831a62c8ebdb4934781ddd15f43f
7
- data.tar.gz: c62c7fe06f090b2310f0f67196d1b6bcbe882795dac96cf4eab393959eddb4aeca83b94c3f04d83e9785560a34f59c49089d83a310d5953f56b18bde88c4f82b
6
+ metadata.gz: 369d8763153074cb274afba5cf386c1c17596de59ac96d1e5686ba0471c8cdd6caac3a37e373b5e1897c8fc4dbb8440f92fca8ac57dfe3c69d018fa681511b70
7
+ data.tar.gz: f6b11146aaeb36170918144667ae22c49cf925cd3cb7dffab0c963e016f9da328fbc5d17b8f638f5c1c6a554571e394a7191daefc6785503347a036ac7fd5f79
@@ -6,10 +6,11 @@ module PandaPal::Concerns
6
6
 
7
7
  # @return PandaPal::Session
8
8
  def panda_pal_session
9
- @panda_pal_session ||= begin
10
- raise "Ability class needs to set @panda_pal_session or @controller to use this feature" unless @controller.present?
11
- @controller.current_session(create_missing: false)
12
- end
9
+ unless defined?(@panda_pal_session) || @controller.present? || method(:panda_pal_session).owner == PandaPal::Concerns::AbilityHelper
10
+ raise "Ability class needs to set @panda_pal_session or @controller to use this feature"
11
+ end
12
+
13
+ @panda_pal_session = @controller.current_session(create_missing: false) unless defined?(@panda_pal_session)
13
14
 
14
15
  if @panda_pal_session.is_a?(Hash)
15
16
  # This is a breaking-change to CanvasSync, but not to PandaPal
@@ -20,10 +21,11 @@ module PandaPal::Concerns
20
21
  end
21
22
 
22
23
  def rails_session
23
- @rails_session ||= begin
24
- raise "Ability class needs to set @rails_session or @controller to use this feature" unless @controller.present?
25
- @controller.session
26
- end
24
+ unless defined?(@rails_session) || @controller.present? || method(:rails_session).owner == PandaPal::Concerns::AbilityHelper
25
+ raise "Ability class needs to set @rails_session or @controller to use this feature"
26
+ end
27
+
28
+ @rails_session ||= @controller.session unless defined?(@rails_session)
27
29
  end
28
30
 
29
31
  # Delegate legacy AbilityHelper methods to panda_pal_session. TODO Should such direct usage be considered deprecated?
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.9.10"
2
+ VERSION = "5.9.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.9.10
4
+ version: 5.9.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure CustomDev