logical_model 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/logical_model/cache.rb +14 -7
- data/lib/logical_model.rb +2 -1
- data/logical_model.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e39e999bb8e8bc84b5c5138ff7e00cce49cc36236e2a3d5db824b1b9ff5a42d6
|
4
|
+
data.tar.gz: a54435e1300de1680bb3e1570aa42745177d041162d0a8c3ccc3adf5624a62f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d200e9487a6a3313d5d5d9ac44a80968731efdb6512f8f6a8daed1ede078b1e01774af2a3739d88f174b3be2c40f396f7de6333db6381528d781eec9734b1464
|
7
|
+
data.tar.gz: db7008d138444048699f5b09e5fe1c3fe66a0c308ddbd4092a2e18c0fab621ba8f75dcc479acfb8294d6e6d847a6a886338e44149f8747fa1926c5a761421318
|
data/lib/logical_model/cache.rb
CHANGED
@@ -24,7 +24,8 @@ class LogicalModel
|
|
24
24
|
delete_cached
|
25
25
|
_save_without_cache
|
26
26
|
end
|
27
|
-
|
27
|
+
alias_method :_save_without_cache, :_save
|
28
|
+
alias_method :_save, :_save_with_cache
|
28
29
|
|
29
30
|
def _update(params={})
|
30
31
|
super
|
@@ -34,7 +35,8 @@ class LogicalModel
|
|
34
35
|
delete_cached
|
35
36
|
_update_without_cache params
|
36
37
|
end
|
37
|
-
|
38
|
+
alias_method :_update_without_cache, :_update
|
39
|
+
alias_method :_update, :_update_with_cache
|
38
40
|
|
39
41
|
def _destroy(params={})
|
40
42
|
super
|
@@ -44,7 +46,8 @@ class LogicalModel
|
|
44
46
|
delete_cached
|
45
47
|
_destroy_without_cache
|
46
48
|
end
|
47
|
-
|
49
|
+
alias_method :_destroy_without_cache, :_destroy
|
50
|
+
alias_method :_destroy, :_destroy_with_cache
|
48
51
|
|
49
52
|
def delete_cached
|
50
53
|
model_name = self.class.to_s.pluralize.underscore
|
@@ -98,7 +101,8 @@ class LogicalModel
|
|
98
101
|
async_find_without_cache(id, params, &block)
|
99
102
|
end
|
100
103
|
end
|
101
|
-
|
104
|
+
alias_method :async_find_without_cache, :async_find
|
105
|
+
alias_method :async_find, :async_find_with_cache
|
102
106
|
|
103
107
|
def async_find_response(id, params={}, body)
|
104
108
|
super(id, params, body)
|
@@ -114,7 +118,8 @@ class LogicalModel
|
|
114
118
|
self.cache_store.write(cache_key, cache_value, :expires_in => self.expires_in || 10.minutes)
|
115
119
|
cache_value
|
116
120
|
end
|
117
|
-
|
121
|
+
alias_method :async_find_response_without_cache, :async_find_response
|
122
|
+
alias_method :async_find_response, :async_find_response_with_cache
|
118
123
|
|
119
124
|
def delete(id, params={})
|
120
125
|
super(id, params)
|
@@ -127,7 +132,8 @@ class LogicalModel
|
|
127
132
|
#TODO: also delete cache for parent (belongs_to)
|
128
133
|
delete_without_cache(id, params)
|
129
134
|
end
|
130
|
-
|
135
|
+
alias_method :delete_without_cache, :delete
|
136
|
+
alias_method :delete, :delete_with_cache
|
131
137
|
|
132
138
|
def delete_multiple(ids, params={})
|
133
139
|
super(ids, params)
|
@@ -140,7 +146,8 @@ class LogicalModel
|
|
140
146
|
#TODO: also delete cache for parent (belongs_to)
|
141
147
|
delete_multiple_without_cache(ids, params)
|
142
148
|
end
|
143
|
-
|
149
|
+
alias_method :delete_multiple_without_cache, :delete_multiple
|
150
|
+
alias_method :delete_multiple, :delete_multiple_with_cache
|
144
151
|
end
|
145
152
|
end
|
146
153
|
end
|
data/lib/logical_model.rb
CHANGED
@@ -86,7 +86,8 @@ class LogicalModel
|
|
86
86
|
initialize_without_callback(attributes)
|
87
87
|
end
|
88
88
|
end
|
89
|
-
|
89
|
+
alias_method :initialize_without_callback, :initialize
|
90
|
+
alias_method :initialize, :initialize_with_callback
|
90
91
|
|
91
92
|
class << self
|
92
93
|
attr_accessor :timeout, :retries,
|
data/logical_model.gemspec
CHANGED