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 +4 -4
- data/lib/redisize/orm/active_record.rb +37 -3
- data/lib/redisize/version.rb +1 -1
- data/lib/redisize.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f15483f3d01901dd9a9807691e315d3e5d2ac3e95d5a583b2422cd4487ed3ce9
|
4
|
+
data.tar.gz: e41ebdc226aa538d13582432e8b1aacbbeef32f347392ff6147c14ea2fe6f65c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
7
|
-
|
8
|
-
|
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
|
data/lib/redisize/version.rb
CHANGED
data/lib/redisize.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|