public
Description: Store translation strings in the database allowing you to update text without requiring a code deploy.
Clone URL: git://github.com/caring/gibberish_db.git
Instead of writing methods for to_s and to_str, just alias them in.
dustin (author)
Thu Apr 24 13:04:31 -0700 2008
dustin (committer)
Thu Apr 24 13:06:34 -0700 2008
commit  f29a9a3715153621c32c2cec6e560a4f19e07d14
tree    75f222402643a28ecc73d42c3b78f35ffdca048a
parent  aa337e299d4a14e3747805378bd65db5fdee9cc3
...
84
85
86
 
 
87
88
89
...
99
100
101
102
103
104
105
106
107
108
109
110
111
112
...
84
85
86
87
88
89
90
91
...
101
102
103
 
 
 
 
 
 
 
 
104
105
106
0
@@ -84,6 +84,8 @@ module Gibberish
0
         interpolate_with_strings(self.value, args)
0
       end
0
     end
0
+ alias_method :to_s, :interpolated_value
0
+ alias_method :to_str, :interpolated_value
0
 
0
     def interpolate_with_hash(string, hash)
0
       hash.inject(string) do |target, (search, replace)|
0
@@ -99,14 +101,6 @@ module Gibberish
0
     def interpolate_with_strings(string, strings)
0
       string.gsub(/\{\w+\}/) { strings.shift }
0
     end
0
-
0
- def to_str
0
- interpolated_value
0
- end
0
-
0
- def to_s
0
- interpolated_value
0
- end
0
     
0
     def to_html
0
       if Translation.suppress_html_wrapper?

Comments

    No one has commented yet.