noticed 2.5.1 → 2.6.0

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: 8e02a5a52bcb1a03842de3987b485c1b9dcfa061ec9ebec81c30188d1f7f17ac
4
- data.tar.gz: e53c49649b8e3fb960f2bf00ba041e2c6790e755dcf5e470ca6a22d95c7e9e7b
3
+ metadata.gz: 04e620f63d7f92b5220c39fa3bb848d8c8905b39a93e8d5c32b7d904f462e694
4
+ data.tar.gz: 43e89757c72ea2475171a080a2ff0881100e229298bfa63d8b816e17e44aa5cd
5
5
  SHA512:
6
- metadata.gz: 94906ad5fdc52cd42968466db06b9d013732bff427e758626fd255b7405a4741c355bf2fe3451a4b2c554362e5084e42590ab9f1253e3a8bac091c7e2ea93c94
7
- data.tar.gz: c78a8e906f66e791f22410466d1b80319689060249dd17702c9c5c85bd836ab6ea5212bd5258733973f9f790f0d20e3226e0e6920f9dbf1b16b879a5d5a074d3
6
+ metadata.gz: 444c47faf233395d77b9ccb003a99f8e45768298f27eac35318f36f5f385ee5ca76f91bbd189e92e3bfb7e50f2ffdaec58ea87e42a6f68c6e5d8e4ee6a61baaf
7
+ data.tar.gz: aeea21827f7eb7071ad482babe06a130a69b27190b15ada99bf3727fa522eb75c4fb8d460d28234f604177a11ae3c34f4a3b6a0c218aebe7d7538577aa1cc465
@@ -10,20 +10,28 @@ module Noticed
10
10
  end
11
11
 
12
12
  class_methods do
13
- def mark_as_read
14
- update_all(read_at: Time.current, updated_at: Time.current)
13
+ def mark_as_read_and_seen(**kwargs)
14
+ update_all(**kwargs.with_defaults(read_at: Time.current, seen_at: Time.current, updated_at: Time.current))
15
15
  end
16
16
 
17
- def mark_as_unread
18
- update_all(read_at: nil, updated_at: Time.current)
17
+ def mark_as_unread_and_unseen(**kwargs)
18
+ update_all(**kwargs.with_defaults(read_at: nil, seen_at: nil, updated_at: Time.current))
19
19
  end
20
20
 
21
- def mark_as_seen
22
- update_all(seen_at: Time.current, updated_at: Time.current)
21
+ def mark_as_read(**kwargs)
22
+ update_all(**kwargs.with_defaults(read_at: Time.current, updated_at: Time.current))
23
23
  end
24
24
 
25
- def mark_as_unseen
26
- update_all(seen_at: nil, updated_at: Time.current)
25
+ def mark_as_unread(**kwargs)
26
+ update_all(**kwargs.with_defaults(read_at: nil, updated_at: Time.current))
27
+ end
28
+
29
+ def mark_as_seen(**kwargs)
30
+ update_all(**kwargs.with_defaults(seen_at: Time.current, updated_at: Time.current))
31
+ end
32
+
33
+ def mark_as_unseen(**kwargs)
34
+ update_all(**kwargs.with_defaults(seen_at: nil, updated_at: Time.current))
27
35
  end
28
36
  end
29
37
 
@@ -1,3 +1,3 @@
1
1
  module Noticed
2
- VERSION = "2.5.1"
2
+ VERSION = "2.6.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noticed
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-09 00:00:00.000000000 Z
10
+ date: 2025-01-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails