CachedSupermodel 0.1.2 → 0.1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +23 -12
- data/Rakefile +3 -2
- data/lib/cs_active_record.rb +6 -1
- metadata +4 -4
data/README.txt
CHANGED
@@ -16,7 +16,10 @@ we are limited by commercial requirements rather than open source idealism.
|
|
16
16
|
|
17
17
|
== FEATURES/PROBLEMS:
|
18
18
|
|
19
|
-
*
|
19
|
+
* Through associations are not invalidated _at_all_ in the end association right now. Ex:
|
20
|
+
* User has_many :taggings
|
21
|
+
* User has_many :tags, :through => :taggings, :source => :tag
|
22
|
+
* If you now remove tags without removing taggings the user will still have those tags in the User#tags collection.
|
20
23
|
|
21
24
|
== SYNOPSYS:
|
22
25
|
|
@@ -32,17 +35,25 @@ we are limited by commercial requirements rather than open source idealism.
|
|
32
35
|
|
33
36
|
== LICENSE:
|
34
37
|
|
35
|
-
|
36
|
-
modify it under the terms of the GNU General Public License
|
37
|
-
as published by the Free Software Foundation; either version 2
|
38
|
-
of the License, or (at your option) any later version.
|
38
|
+
(The MIT License)
|
39
39
|
|
40
|
-
|
41
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
42
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
43
|
-
GNU General Public License for more details.
|
40
|
+
Copyright (c) 2006 Albert Ramstedt, Adocca AB
|
44
41
|
|
45
|
-
|
46
|
-
|
47
|
-
|
42
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
43
|
+
a copy of this software and associated documentation files (the
|
44
|
+
'Software'), to deal in the Software without restriction, including
|
45
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
46
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
47
|
+
permit persons to whom the Software is furnished to do so, subject to
|
48
|
+
the following conditions:
|
48
49
|
|
50
|
+
The above copyright notice and this permission notice shall be
|
51
|
+
included in all copies or substantial portions of the Software.
|
52
|
+
|
53
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
54
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
55
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
56
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
57
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
58
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
59
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -4,10 +4,11 @@ require 'rubygems'
|
|
4
4
|
require 'hoe'
|
5
5
|
require './lib/cached_supermodel.rb'
|
6
6
|
|
7
|
-
Hoe.new('CachedSupermodel', '0.1.2') do |p|
|
8
|
-
p.rubyforge_name = 'adocca-plugins'
|
7
|
+
Hoe.new('CachedSupermodel', '0.1.2.1') do |p|
|
9
8
|
p.summary = 'A library that automatically caches all ActiveRecord::Base instances in memcache using the AdoccaMemcache gem.'
|
10
9
|
p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
|
10
|
+
p.author = 'adocca Entertainment AB'
|
11
|
+
p.rubyforge_name = "adocca-plugins"
|
11
12
|
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
12
13
|
p.extra_deps << ['AdoccaMemcache', '>= 0.1.0']
|
13
14
|
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
data/lib/cs_active_record.rb
CHANGED
@@ -45,7 +45,12 @@ class ActiveRecord::Base
|
|
45
45
|
attributes = match[2].to_s.split(/_and_/)
|
46
46
|
define_method("invalidate_cached_#{finder}") do
|
47
47
|
unless self.new_record?
|
48
|
-
|
48
|
+
begin
|
49
|
+
self.class.find(self.id).send("non_recursive_invalidate_cached_#{finder}")
|
50
|
+
rescue Exception => e
|
51
|
+
# This can fail just because our saving broke a transaction, in that case
|
52
|
+
# we wont exist, even if we happen to have an id (and !new_record?)
|
53
|
+
end
|
49
54
|
end
|
50
55
|
self.send("non_recursive_invalidate_cached_#{finder}")
|
51
56
|
end
|
metadata
CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: CachedSupermodel
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.2
|
7
|
-
date: 2006-12-
|
6
|
+
version: 0.1.2.1
|
7
|
+
date: 2006-12-22 00:00:00 +01:00
|
8
8
|
summary: A library that automatically caches all ActiveRecord::Base instances in memcache using the AdoccaMemcache gem.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: ryand-ruby@zenspider.com
|
12
12
|
homepage: " by Adocca AB"
|
13
13
|
rubyforge_project: adocca-plugins
|
14
|
-
description: "Based on cached_model by <a href=\"http://dev.robotcoop.com/\">robotcoop</a>. We started out with their code, but added so much that it merited its own plugin. Apologies for not doing proper contributions to their project instead of building our own, but we are limited by commercial requirements rather than open source idealism. == FEATURES/PROBLEMS: *
|
14
|
+
description: "Based on cached_model by <a href=\"http://dev.robotcoop.com/\">robotcoop</a>. We started out with their code, but added so much that it merited its own plugin. Apologies for not doing proper contributions to their project instead of building our own, but we are limited by commercial requirements rather than open source idealism. == FEATURES/PROBLEMS: * Through associations are not invalidated _at_all_ in the end association right now. Ex: * User has_many :taggings * User has_many :tags, :through => :taggings, :source => :tag * If you now remove tags without removing taggings the user will still have those tags in the User#tags collection. == SYNOPSYS:"
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
@@ -26,7 +26,7 @@ platform: ruby
|
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
28
|
authors:
|
29
|
-
-
|
29
|
+
- adocca Entertainment AB
|
30
30
|
files:
|
31
31
|
- History.txt
|
32
32
|
- Manifest.txt
|