public
Description: Allows the caching of lookup data in your Rails models
Clone URL: git://github.com/vigetlabs/constant_cache.git
Moved patching of String class back into init.rb
Re-use code in init.rb for test runs

git-svn-id: 
http://svn.extendviget.com/lab/trunk/plugins/caches_constants@149 
e959a6d6-1924-0410-92b3-a6fa492f4c66
reagent (author)
Fri Jul 13 05:56:57 -0700 2007
commit  350806f8a30a53d0289c9cd3234f5e26d350dca4
tree    9caae1fedffaf5dac017a69449faf4e6f6d3bc2f
parent  5a865e722f625b5ef224edda652c41c94e7e7a6d
...
1
2
 
3
 
 
 
 
4
...
 
 
1
2
3
4
5
6
7
0
@@ -1,4 +1,7 @@
0
-require 'format'
0
-require 'constant_cache'
0
+lib_dir = File.dirname(__FILE__) + '/lib'
0
 
0
+require "#{lib_dir}/format"
0
+require "#{lib_dir}/constant_cache"
0
+
0
+String.send(:include, Viget::Format)
0
 ActiveRecord::Base.send(:extend, Viget::ConstantCache::ClassMethods)
...
6
7
8
9
10
11
12
13
 
14
...
6
7
8
 
 
 
 
9
10
11
0
@@ -6,7 +6,4 @@ module Viget
0
       value
0
     end
0
   end
0
-end
0
-
0
-# This only appears to work here, and not in init.rb (need to investigate w/ non-edge Rails)
0
-class String; include Viget::Format; end
0
\ No newline at end of file
0
+end
0
\ No newline at end of file
...
4
5
6
7
8
9
10
11
 
 
12
...
4
5
6
 
 
7
 
8
9
10
11
0
@@ -4,7 +4,6 @@ require 'rubygems'
0
 require 'test/unit'
0
 require 'mocha'
0
 require 'active_record'
0
-require "#{lib_dir}/format"
0
-require "#{lib_dir}/constant_cache"
0
 
0
-ActiveRecord::Base.send(:extend, Viget::ConstantCache::ClassMethods)
0
\ No newline at end of file
0
+# Re-use plugin initialization
0
+require File.dirname(__FILE__) + '/init'
0
\ No newline at end of file

Comments

    No one has commented yet.