panda_pal 5.9.9 → 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: 16bcf4f72e56b52fdec3f6e6b537e91225ea9effba4d091876a505be4a5a2743
4
- data.tar.gz: 5de224cfbc6895b735a4e26e427e470b8f8fe42bc5c486a3837e0b2c79ba2ba7
3
+ metadata.gz: 7c75994a45a1847fd90718c94cd9ddb089f2d34d30fd3bc88f30c68cdaa3c104
4
+ data.tar.gz: ecd5df18b57808c26031538eac7be097b8c35a711a11fd37be482e6bc0c18747
5
5
  SHA512:
6
- metadata.gz: d6cc863556e1acd683b74a765aef84493004fb3af25dade1f6dafac035523fa63009c929a58cd0129d5a7899673ded1fb5170dff56da81e3d628969675c7e58d
7
- data.tar.gz: 5f0f6c2d59ed052b0494a7d983bfb13550a6dffa1a1b4e2410eaa828fd58c143337f58739423fecbbe023df4ff64542f8af42a0fca6090f64284d44bb55d05d8
6
+ metadata.gz: 369d8763153074cb274afba5cf386c1c17596de59ac96d1e5686ba0471c8cdd6caac3a37e373b5e1897c8fc4dbb8440f92fca8ac57dfe3c69d018fa681511b70
7
+ data.tar.gz: f6b11146aaeb36170918144667ae22c49cf925cd3cb7dffab0c963e016f9da328fbc5d17b8f638f5c1c6a554571e394a7191daefc6785503347a036ac7fd5f79
@@ -7,7 +7,7 @@ module PandaPal
7
7
  end
8
8
 
9
9
  def [](key)
10
- if column_names.include?(key.to_s)
10
+ if self.class.column_names.include?(key.to_s)
11
11
  super
12
12
  else
13
13
  data[key]
@@ -15,7 +15,7 @@ module PandaPal
15
15
  end
16
16
 
17
17
  def []=(key, value)
18
- if column_names.include?(key.to_s)
18
+ if self.class.column_names.include?(key.to_s)
19
19
  super
20
20
  else
21
21
  data[key] = value
@@ -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.9"
2
+ VERSION = "5.9.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.9.9
4
+ version: 5.9.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure CustomDev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-24 00:00:00.000000000 Z
11
+ date: 2024-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails