sequel-soft-destroy 0.0.1 → 0.0.2

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
- SHA1:
3
- metadata.gz: 307895206c73cd43079f99c83aa643c391e22f4a
4
- data.tar.gz: f43efe87305c17b7ace9e8723ff0dd8858d17cde
2
+ SHA256:
3
+ metadata.gz: 98637f765d7722bb6d4518fa9b94b4939eecbd4824f63be024fbbb2a9c27bc67
4
+ data.tar.gz: 55425887148c8bd506eae1cfa10cab7045f79a382bfdf3617903097e700478c1
5
5
  SHA512:
6
- metadata.gz: cb2b4aa7829f6a8bd4393c789b5da914821e13a09f75b00c707cbdbce414383651a515d9226132a79f26fea0858731f62a3c4c3adbb5090fd10c8f223e40a73b
7
- data.tar.gz: 54785dfdf8ea36aba9de166a8a6185842f0077cc24f6089b7f6fbfcb6153ffee91a52f4934f50c6021b320408d70f81a1c85d359a57b0972b6e37ca2ffef3f9e
6
+ metadata.gz: 81ca35cb71072c13b15b62c7ccaf4c383634d99b63318887326772379c813ff7313689273d0eaee39d2a04f2ae8f559d28969a2368634bcf3297cf6941e5a279
7
+ data.tar.gz: 70b2d657d057e9a68533b6b6fcd71d75f9020693a34ac0ce04541c5be681ab23077618a312e8382d1ad60ae53cb45681fee46696bc5697ad00f18057aeb6b34a
@@ -9,7 +9,13 @@ module Sequel
9
9
  Sequel::Plugins.def_dataset_methods(self, :filter_deleted)
10
10
 
11
11
  def [](*args)
12
- model = super
12
+ args = args.first if args.size <= 1
13
+
14
+ return filter_deleted.first(args) if args.is_a?(Hash)
15
+
16
+ return if args.nil?
17
+
18
+ model = primary_key_lookup(args)
13
19
 
14
20
  return if model.nil? || model.deleted?
15
21
 
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
2
2
  s.name = "sequel-soft-destroy"
3
3
  s.author = "Federico Saravia"
4
4
  s.email = "fedesaravia@gmail.com"
5
- s.version = "0.0.1"
5
+ s.version = "0.0.2"
6
6
  s.summary = "A simple Sequel plugin that provides soft delete capabilities."
7
7
  s.homepage = "https://github.com/fsaravia/sequel-soft-destroy"
8
8
  s.license = "MIT"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-soft-destroy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Saravia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-27 00:00:00.000000000 Z
11
+ date: 2019-07-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: fedesaravia@gmail.com
@@ -39,8 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  requirements: []
42
- rubyforge_project:
43
- rubygems_version: 2.6.11
42
+ rubygems_version: 3.0.3
44
43
  signing_key:
45
44
  specification_version: 4
46
45
  summary: A simple Sequel plugin that provides soft delete capabilities.