redisize 0.1.0 → 0.1.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: 4dd240d50c272014c6d147455c340d73dee4cba93015ce7f37a7f43af920e44b
4
- data.tar.gz: 604bf60003f3e2ca84037a70d46769c3e791bc56a108b6e0190a5442a00edc88
3
+ metadata.gz: f15483f3d01901dd9a9807691e315d3e5d2ac3e95d5a583b2422cd4487ed3ce9
4
+ data.tar.gz: e41ebdc226aa538d13582432e8b1aacbbeef32f347392ff6147c14ea2fe6f65c
5
5
  SHA512:
6
- metadata.gz: f69e2bbf3956f302194e1d3cda8afe59e9408e7823f7fbe5eee755a2c8fb3c78cf5a7edf66a7292181226e2dccde925eacf5c501475469387cf7f7d30ab709fd
7
- data.tar.gz: 99a168322bc6fbe43a8f920f9310ec11bae7f57cd7fdf128024cfcd9be0547cf075c9f730558c8cdd0fb8b16426b937b54734a581e3d21195114f91bfe1e4aa0
6
+ metadata.gz: 25d10fe2876bd49114431ae4d655f83abbd7288446b86c3742bca58b1b2786758e030683e96155a037c804f78d02ef368cb9a4b675eb5ea4a374fb7fdecf1180
7
+ data.tar.gz: b1dc29c5cbc17830a77a6a86cf671a3a2fde8f0854f2a37cd2b98e5b7fec2d9aa7e588c683c9eb7557b1bf122fb55471de5c0e0ad299a908c094fd4b2dbe2afc
@@ -3,9 +3,43 @@ module Redisize
3
3
  module ActiveRecord
4
4
  def self.included kls
5
5
  kls.class_eval do
6
- after_create :deredisize_model
7
- after_save :reredisize_instance
8
- after_destroy :deredisize_instance, :deredisize_model
6
+ alias_method :__redisize_create_or_update, :create_or_update
7
+ alias_method :__redisize_destroy, :destroy
8
+ alias_method :__redisize_update_columns, :update_columns
9
+ alias_method :__redisize_touch, :touch
10
+
11
+ def create_or_update **args, &block
12
+ new_record = new_record?
13
+ state = __redisize_create_or_update(**args, &block)
14
+
15
+ new_record && deredisize_model || reredisize_instance
16
+
17
+ state
18
+ end
19
+
20
+ def update_columns **args
21
+ state = __redisize_update_columns(**args)
22
+
23
+ reredisize_instance
24
+
25
+ state
26
+ end
27
+
28
+ def touch **args
29
+ state = __redisize_touch(**args)
30
+
31
+ reredisize_instance
32
+
33
+ state
34
+ end
35
+
36
+ def destroy
37
+ state = __redisize_destroy
38
+
39
+ %i(deredisize_instance deredisize_model).each {|m| send(m) }
40
+
41
+ state
42
+ end
9
43
  end
10
44
  end
11
45
  end
@@ -1,3 +1,3 @@
1
1
  module Redisize
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/redisize.rb CHANGED
@@ -80,7 +80,7 @@ module Redisize
80
80
  end
81
81
 
82
82
  def enqueue method, *args
83
- adapter.enqueue(method, *args)
83
+ adapter.enqueue(method.to_s, *args)
84
84
  end
85
85
 
86
86
  def filtered_for attrs, klass
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redisize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel «Malo» Skrylev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-26 00:00:00.000000000 Z
11
+ date: 2022-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry