public
Fork of joshmh/globalize2
Description: The second incarnation of Globalize for Rails
Homepage: http://www.globalize-rails.org/
Clone URL: git://github.com/hchoroomi/globalize2.git
Fixed the migration generator
hchoroomi (author)
Wed Jan 07 07:54:30 -0800 2009
commit  24d07124de6ecc1d1332a0b896e1fbb2b2aea8f8
tree    b05c1960fe31d70de9ba82bffd189516f8e01643
parent  b6a2a0d0b4653f33d1d6f62e019015976da75cf3
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ require 'rails_edge_load_path_patch.rb' unless I18n.respond_to?(:load_path)
0
 
0
 ActiveRecord::Base.send :include, Globalize::Model::ActiveRecord::Translated
0
 
0
-I18n.backend = Globalize::Backend::Static.new
0
+I18n.backend = Globalize::Backend::Db.new
0
 
0
 I18n.load_path = Globalize::LoadPath.new I18n.load_path
0
 I18n.load_path << "#{File.dirname(__FILE__)}/lib/locale"
...
1
2
 
3
4
5
...
7
8
9
10
 
11
12
13
...
1
 
2
3
4
5
...
7
8
9
 
10
11
12
13
0
@@ -1,5 +1,5 @@
0
 class DbTranslation < ActiveRecord::Base
0
-  set_table_name "translations"
0
+  set_table_name "globalize_translations"
0
   serialize :value
0
   belongs_to :locale, :class_name => "DbTranslationLocale", :foreign_key => "locale_id"
0
   validates_presence_of :key
0
@@ -7,7 +7,7 @@ class DbTranslation < ActiveRecord::Base
0
   validates_uniqueness_of :key, :scope => :locale_id
0
   
0
   after_save do |record|
0
-    record.locale.updated_at_will_change!
0
+    #record.locale.updated_at_will_change!
0
     record.locale.save(false)
0
   end
0
 end
...
1
2
 
3
4
 
5
6
7
...
1
 
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 class DbTranslationLocale < ActiveRecord::Base
0
-  set_table_name "translation_locales"
0
+  set_table_name "globalize_translation_locales"
0
   acts_as_tree
0
-  belongs_to :creator, :class_name => "User", :foreign_key => "user_id"
0
+  #belongs_to :creator, :class_name => "User", :foreign_key => "user_id"
0
   has_many :translations, :class_name => "DbTranslation", :foreign_key => "locale_id", :dependent => :destroy
0
   
0
   validates_presence_of :locale

Comments