sequel-privacy 0.2.1 → 0.3

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
  SHA256:
3
- metadata.gz: 04b5728dab12a15490535725e9458d1039e17049f47e839e724b5464b1e39ee5
4
- data.tar.gz: ddb26ed4c76c15b672043d2ac32ff4573b791befc8c9f3b1d0405e0c4ddcd6ba
3
+ metadata.gz: fd27576a058e95f92fd4c50fc1f5da0e058d0b7f93c3f114b88757a08651dd29
4
+ data.tar.gz: f429f5fc246fcd7cb043170a8166b7bc06fa04125aa4c89d6fe196b4c5bead31
5
5
  SHA512:
6
- metadata.gz: 1b235a397d24fbfea16f557628554b5e64352a2872b54d9b51b36e81d13fe659be3b1a011e256626db7025dc7527b33e891866c116e4a1dbe4a03821209401c6
7
- data.tar.gz: 105bb81dc55bb0970a224682c7ab30117758e882db8acac968802da1ed0fa06bd29145350d9de196dda2f6b5d0f81b7c58433e1107317ab8f4b7d297a5ee2c53
6
+ metadata.gz: c58b5116d0b2a0ac0acf829612cdf46ee3ec1ef08879d189bbf94170248ac8cbf6a540601de6794bf6f03086e5af4e2f555291ac5d2de22a5405f1fb61ab066a
7
+ data.tar.gz: bf580a74fcb95fc328f7d0564877804ef642783442254af86d436ae853b89d88f71cd5abb6cff95ba56ed38992261557049350081bad9d35d63a80ce7ebbde96
@@ -302,6 +302,8 @@ module Sequel
302
302
  vc = instance_variable_get(:@viewer_context)
303
303
 
304
304
  unless vc
305
+ return original_method.bind(self).() if T.unsafe(self.class).allow_unsafe_access?
306
+
305
307
  Kernel.raise Sequel::Privacy::MissingViewerContext,
306
308
  "#{self.class}##{field} requires a ViewerContext"
307
309
  end
@@ -518,6 +520,8 @@ module Sequel
518
520
  vc = instance_variable_get(:@viewer_context)
519
521
 
520
522
  unless vc
523
+ return original.bind(self).(obj) if T.unsafe(self.class).allow_unsafe_access?
524
+
521
525
  Kernel.raise Sequel::Privacy::MissingViewerContext,
522
526
  "Cannot #{method_name} without a viewer context"
523
527
  end
@@ -548,6 +552,8 @@ module Sequel
548
552
  vc = instance_variable_get(:@viewer_context)
549
553
 
550
554
  unless vc
555
+ return original.bind(self).(obj) if T.unsafe(self.class).allow_unsafe_access?
556
+
551
557
  Kernel.raise Sequel::Privacy::MissingViewerContext,
552
558
  "Cannot #{method_name} without a viewer context"
553
559
  end
@@ -578,6 +584,8 @@ module Sequel
578
584
  vc = instance_variable_get(:@viewer_context)
579
585
 
580
586
  unless vc
587
+ return original.bind(self).() if T.unsafe(self.class).allow_unsafe_access?
588
+
581
589
  Kernel.raise Sequel::Privacy::MissingViewerContext,
582
590
  "Cannot #{method_name} without a viewer context"
583
591
  end
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Sequel
5
5
  module Privacy
6
- VERSION = '0.2.1'
6
+ VERSION = '0.3'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-privacy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Bales