summaryrefslogtreecommitdiff
path: root/vendor/plugins/globalize2/test/data/models.rb
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2010-01-14 22:21:43 +0100
committerhukl <contact@smyck.org>2010-01-14 22:21:43 +0100
commit57d1382013c85a7b11ac8ce5e683f6006b12b328 (patch)
tree19646c4fa5952fa1cf0a2c874952affa346373f1 /vendor/plugins/globalize2/test/data/models.rb
parent1b86bf5f2e35d1820bfa32d979bcc2d9ff9a9a8e (diff)
Updated globalize2 to latest version. Modified existing code accoringly
Diffstat (limited to 'vendor/plugins/globalize2/test/data/models.rb')
-rw-r--r--vendor/plugins/globalize2/test/data/models.rb26
1 files changed, 24 insertions, 2 deletions
diff --git a/vendor/plugins/globalize2/test/data/models.rb b/vendor/plugins/globalize2/test/data/models.rb
index f6dab903..553fca35 100644
--- a/vendor/plugins/globalize2/test/data/models.rb
+++ b/vendor/plugins/globalize2/test/data/models.rb
@@ -1,6 +1,16 @@
1#require 'ruby2ruby'
2#require 'parse_tree'
3#require 'parse_tree_extensions'
4#require 'pp'
5
6class PostTranslation < ActiveRecord::Base
7 def existing_method ; end
8end
9
1class Post < ActiveRecord::Base 10class Post < ActiveRecord::Base
2 translates :subject, :content 11 translates :subject, :content
3 validates_presence_of :subject 12 validates_presence_of :subject
13 named_scope :foobar, :conditions => { :title => "foobar" }
4end 14end
5 15
6class Blog < ActiveRecord::Base 16class Blog < ActiveRecord::Base
@@ -18,7 +28,7 @@ class Comment < ActiveRecord::Base
18 validates_presence_of :content 28 validates_presence_of :content
19 belongs_to :post 29 belongs_to :post
20end 30end
21 31
22class TranslatedComment < Comment 32class TranslatedComment < Comment
23 translates :content 33 translates :content
24end 34end
@@ -26,4 +36,16 @@ end
26class UltraLongModelNameWithoutProper < ActiveRecord::Base 36class UltraLongModelNameWithoutProper < ActiveRecord::Base
27 translates :subject, :content 37 translates :subject, :content
28 validates_presence_of :subject 38 validates_presence_of :subject
29end \ No newline at end of file 39end
40
41class Reloader < Parent
42 after_create :do_reload
43
44 def do_reload
45 reload
46 end
47end
48
49class Validatee < ActiveRecord::Base
50 translates :string
51end