invisible_record 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
  SHA256:
3
- metadata.gz: 348e376c69c70a25be9552144601bb87c486d4c43da5f1d7d0baa9ec1e64b459
4
- data.tar.gz: 4880ab1e4c89a1525a529da2004b5147fa918241f97a17966871974270ac8368
3
+ metadata.gz: 10509192fe474e4508b2426838c2482969f20a0e7dae34d1a3276b564df125e4
4
+ data.tar.gz: 1bbc70f05d88a28582b03b3743c0c98243b0e22ebe203bd7355f4865edc399cf
5
5
  SHA512:
6
- metadata.gz: 8ce93f839707533489f85284cd4efdd2a6f70d418541e535bcb9821ce2247c3730e25b053a3289d804784d299f51929a9629495d27f2cf9858e04a98d8216405
7
- data.tar.gz: 342fd0ecec940b99e213318255ffc2259a43cb295c13f0894649f769042e2e74ffcabed14a3324dcd11db487fe0b4169517570253771cec5113595d305313d00
6
+ metadata.gz: db212abf77c4cf18b4f8f0e8b37cc3ee4d0c291a37d0571375978f08cc6a5fd0a0988d3b9e3fd74c07823d30400fb880e38ae4f27f392e11baafe0b20894080e
7
+ data.tar.gz: f4c8b9de28a9636187a77595f0329dedf5e830a145a9063493c51e294f9636b42be5fe3347d11b39a69d799836a89bc9c6f9d18a47223bc6b687e7c21b3958b0
@@ -9,36 +9,36 @@
9
9
  <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
10
  <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
11
  </content>
12
- <orderEntry type="jdk" jdkName="rbenv: 3.0.2" jdkType="RUBY_SDK" />
12
+ <orderEntry type="jdk" jdkName="RVM: ruby-3.0.2" jdkType="RUBY_SDK" />
13
13
  <orderEntry type="sourceFolder" forTests="false" />
14
- <orderEntry type="library" scope="PROVIDED" name="activemodel (v6.1.3, rbenv: 3.0.2) [gem]" level="application" />
15
- <orderEntry type="library" scope="PROVIDED" name="activerecord (v6.1.3, rbenv: 3.0.2) [gem]" level="application" />
16
- <orderEntry type="library" scope="PROVIDED" name="activesupport (v6.1.3, rbenv: 3.0.2) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, rbenv: 3.0.2) [gem]" level="application" />
18
- <orderEntry type="library" scope="PROVIDED" name="bundler (v2.2.27, rbenv: 3.0.2) [gem]" level="application" />
19
- <orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.9, rbenv: 3.0.2) [gem]" level="application" />
20
- <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.4.4, rbenv: 3.0.2) [gem]" level="application" />
21
- <orderEntry type="library" scope="PROVIDED" name="i18n (v1.8.11, rbenv: 3.0.2) [gem]" level="application" />
22
- <orderEntry type="library" scope="PROVIDED" name="minitest (v5.14.4, rbenv: 3.0.2) [gem]" level="application" />
23
- <orderEntry type="library" scope="PROVIDED" name="parallel (v1.21.0, rbenv: 3.0.2) [gem]" level="application" />
24
- <orderEntry type="library" scope="PROVIDED" name="parser (v3.0.2.0, rbenv: 3.0.2) [gem]" level="application" />
25
- <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.0.0, rbenv: 3.0.2) [gem]" level="application" />
26
- <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, rbenv: 3.0.2) [gem]" level="application" />
27
- <orderEntry type="library" scope="PROVIDED" name="rbs (v1.0.4, rbenv: 3.0.2) [gem]" level="application" />
28
- <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.1.1, rbenv: 3.0.2) [gem]" level="application" />
29
- <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, rbenv: 3.0.2) [gem]" level="application" />
30
- <orderEntry type="library" scope="PROVIDED" name="rspec (v3.10.0, rbenv: 3.0.2) [gem]" level="application" />
31
- <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.10.1, rbenv: 3.0.2) [gem]" level="application" />
32
- <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.10.1, rbenv: 3.0.2) [gem]" level="application" />
33
- <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.10.2, rbenv: 3.0.2) [gem]" level="application" />
34
- <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.10.3, rbenv: 3.0.2) [gem]" level="application" />
35
- <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.22.3, rbenv: 3.0.2) [gem]" level="application" />
36
- <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.13.0, rbenv: 3.0.2) [gem]" level="application" />
37
- <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, rbenv: 3.0.2) [gem]" level="application" />
38
- <orderEntry type="library" scope="PROVIDED" name="sqlite3 (v1.4.2, rbenv: 3.0.2) [gem]" level="application" />
39
- <orderEntry type="library" scope="PROVIDED" name="tzinfo (v2.0.4, rbenv: 3.0.2) [gem]" level="application" />
40
- <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.1.0, rbenv: 3.0.2) [gem]" level="application" />
41
- <orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.5.1, rbenv: 3.0.2) [gem]" level="application" />
14
+ <orderEntry type="library" scope="PROVIDED" name="activemodel (v6.1.3, RVM: ruby-3.0.2) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="activerecord (v6.1.3, RVM: ruby-3.0.2) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="activesupport (v6.1.3, RVM: ruby-3.0.2) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, RVM: ruby-3.0.2) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.2.27, RVM: ruby-3.0.2) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.9, RVM: ruby-3.0.2) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.4.4, RVM: ruby-3.0.2) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="i18n (v1.8.11, RVM: ruby-3.0.2) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="minitest (v5.14.4, RVM: ruby-3.0.2) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="parallel (v1.21.0, RVM: ruby-3.0.2) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="parser (v3.0.2.0, RVM: ruby-3.0.2) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.0.0, RVM: ruby-3.0.2) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, RVM: ruby-3.0.2) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="rbs (v1.0.4, RVM: ruby-3.0.2) [gem]" level="application" />
28
+ <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.1.1, RVM: ruby-3.0.2) [gem]" level="application" />
29
+ <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, RVM: ruby-3.0.2) [gem]" level="application" />
30
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.10.0, RVM: ruby-3.0.2) [gem]" level="application" />
31
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.10.1, RVM: ruby-3.0.2) [gem]" level="application" />
32
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.10.1, RVM: ruby-3.0.2) [gem]" level="application" />
33
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.10.2, RVM: ruby-3.0.2) [gem]" level="application" />
34
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.10.3, RVM: ruby-3.0.2) [gem]" level="application" />
35
+ <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.22.3, RVM: ruby-3.0.2) [gem]" level="application" />
36
+ <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.13.0, RVM: ruby-3.0.2) [gem]" level="application" />
37
+ <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, RVM: ruby-3.0.2) [gem]" level="application" />
38
+ <orderEntry type="library" scope="PROVIDED" name="sqlite3 (v1.4.2, RVM: ruby-3.0.2) [gem]" level="application" />
39
+ <orderEntry type="library" scope="PROVIDED" name="tzinfo (v2.0.4, RVM: ruby-3.0.2) [gem]" level="application" />
40
+ <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.1.0, RVM: ruby-3.0.2) [gem]" level="application" />
41
+ <orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.5.1, RVM: ruby-3.0.2) [gem]" level="application" />
42
42
  </component>
43
43
  <component name="RakeTasksCache">
44
44
  <option name="myRootTask">
data/CHANGELOG.md CHANGED
@@ -2,4 +2,8 @@
2
2
 
3
3
  ## [0.1.0] - 2021-11-10
4
4
 
5
+ - Change scopes to prevent collisions with models by using `unscoped`.
6
+
7
+ ## [0.1.0] - 2021-11-10
8
+
5
9
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- invisible_record (0.2.0)
4
+ invisible_record (0.2.1)
5
5
  activemodel (>= 5)
6
6
  activerecord (>= 5)
7
7
 
@@ -13,8 +13,8 @@ module InvisibleRecord
13
13
 
14
14
  def define_default_scopes(deleted_ts_attr:)
15
15
  default_scope { where(deleted_ts_attr => nil) }
16
- scope :include_deleted, -> { unscoped.all }
17
- scope :deleted, -> { unscoped.where.not(deleted_ts_attr => nil) }
16
+ scope :include_deleted, -> { unscope(where: deleted_ts_attr.to_sym) }
17
+ scope :deleted, -> { unscope(where: deleted_ts_attr.to_sym).where.not(deleted_ts_attr => nil) }
18
18
  end
19
19
  end
20
20
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InvisibleRecord
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: invisible_record
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
  - Daniel Rejón
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-25 00:00:00.000000000 Z
11
+ date: 2021-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel