redis_page 0.1.6 → 0.1.7

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
  SHA1:
3
- metadata.gz: 37a41cb3eb5f4307328c97116e992ccff5ebcba2
4
- data.tar.gz: 15305dfc72280bf9cb96cf950df92021df3bda9a
3
+ metadata.gz: 60fbc716751fa3131863af257f790baf4c3a9d5d
4
+ data.tar.gz: 45a0c20f1786063effec108fa7e7b8d01bfd05f5
5
5
  SHA512:
6
- metadata.gz: f638a549e0152e3a9dac2aca65a6a2651eeabb7e48a54ba09aa486f19593aebf55afd648c599638b7a5c5f0a78b95d9bd757ce77a42168625b896d4828bbe7ea
7
- data.tar.gz: d0ebdf75cd3ea216172172bb60ce1ac590a610774c4ba3276d9b3a8e1605a55fcfcf7890f46fbf7298db40b6789e69ae9bf791e610d615794a70681308dd7d84
6
+ metadata.gz: 0c05ec1574cc3f302e31a1ec4ec6dd774e0a0c658fb7dc32a3c6eba9f2bcd8f2a1e0d2bd045de18af5a8d4e84ce446e9173a3e04a287782c1d0fec0d9719b370
7
+ data.tar.gz: a87be8a419d764784b9c46584c8e25c70368971438313ea5bc3196e3c70f436adaf8412dee0e6da785bdf4b987ff246fa7572379963ed957bf32736aca6a847f
data/README.md CHANGED
@@ -84,6 +84,20 @@ class Product < ActiveRecord::Base
84
84
  end
85
85
  ```
86
86
 
87
+ ### 5. Collection
88
+
89
+ 删除子记录时要触发父记录更新
90
+
91
+ ```
92
+ collection.products.delete product
93
+ ```
94
+
95
+ 在父记录的 model 关系中增加 after_remove,触发父记录更新
96
+
97
+ ```
98
+ has_many :products, through: :collections_products, after_remove: proc { |a| a.touch }
99
+ ```
100
+
87
101
  ## Contribution
88
102
 
89
103
  ```
@@ -6,6 +6,7 @@ module RedisPage
6
6
 
7
7
  included do
8
8
  after_save :invalidate_instance_cache
9
+ after_touch :invalidate_instance_cache
9
10
  after_destroy :invalidate_clazz_cache
10
11
 
11
12
  def invalidate_instance_cache
@@ -1,3 +1,3 @@
1
1
  module RedisPage
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_page
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - saberma
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-30 00:00:00.000000000 Z
11
+ date: 2015-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport