invisible_record 0.1.3 → 0.1.4

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: 7ee54865fb6e434aab2b548042557c735a02ccef639c5baff053fd412751cfc8
4
- data.tar.gz: e708423f48672b3bcec32c6c65219ce9e4adb0956ccf8bf7897ebfae7eb0190a
3
+ metadata.gz: 9f5db2bde56e730c9c64aa275b9b030ebcb00f9f1e583afe6ef1e9317103b2b1
4
+ data.tar.gz: 694f735be7c384ca3504288beebe01b6aecf08678cc72594ec69a480e6ce927e
5
5
  SHA512:
6
- metadata.gz: f86c3168c0814c91e7d1871b829436b567aa0f2cf3fcef0b8ab548aeaea53cef360482388f248a43fa67b6325782ab1f2e6f7aaaadad05be8352191723a942eb
7
- data.tar.gz: 5d4edb35801ce585c4f03b639f68b56d68b343f9b23ea887f88455f50633ff0e774cd8262cb8896d8d2a85f3f01923cca4549a4cfb0b189221ec08af3e84851e
6
+ metadata.gz: 07f78f41b74c6069e6f8a458fe5480ba62a4d76d223d4ae94223fe1e6c1b668b0be29c63152343dbedffbb06c9ee46f0dd4c7559cebf720bd26727af18083a57
7
+ data.tar.gz: d591bda2f62e19cc39d42d828c0d7ea2fa6d4905502f32f46aadf8d92d8b80a3d647a994dad6cf88a4458e0cbd42d5dd8bc06af13a37a4f1bdc4d734d7107130
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- invisible_record (0.1.3)
4
+ invisible_record (0.1.4)
5
5
  activemodel (>= 5)
6
6
  activerecord (>= 5)
7
7
 
@@ -7,7 +7,7 @@ module InvisibleRecord
7
7
  module Model
8
8
  def acts_as_invisible(**options)
9
9
  options.deep_symbolize_keys!
10
- deleted_timestamp_attr = options[:deleted_timestamp_attribute] || "deleted_at"
10
+ @_deleted_timestamp_attr = options[:deleted_timestamp_attribute] || "deleted_at"
11
11
  raise "Only call acts_as_invisible once per model" if respond_to?(:invisible_record_model?)
12
12
 
13
13
  class_eval do
@@ -15,11 +15,15 @@ module InvisibleRecord
15
15
  def invisible_record_model?
16
16
  true
17
17
  end
18
+
19
+ def without_deleted
20
+ where(@_deleted_timestamp_attr => nil)
21
+ end
18
22
  end
19
23
 
20
- Helper.define_hidden_attributes self, deleted_ts_attr: deleted_timestamp_attr
24
+ Helper.define_hidden_attributes self, deleted_ts_attr: @_deleted_timestamp_attr
21
25
 
22
- Helper.define_actions self, deleted_ts_attr: deleted_timestamp_attr
26
+ Helper.define_actions self, deleted_ts_attr: @_deleted_timestamp_attr
23
27
  end
24
28
  end
25
29
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InvisibleRecord
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
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.1.3
4
+ version: 0.1.4
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-19 00:00:00.000000000 Z
11
+ date: 2021-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel