wakari 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ module Wakari
|
|
9
9
|
module ClassMethods
|
10
10
|
|
11
11
|
def acts_as_content_class(translation_class, association_name, options)
|
12
|
-
has_many association_name, :class_name => translation_class.name, :inverse_of => :content, :order => :position, :autosave => true, :foreign_key => :content_id
|
12
|
+
has_many association_name, :class_name => "::Object::#{translation_class.name}", :inverse_of => :content, :order => :position, :autosave => true, :foreign_key => :content_id
|
13
13
|
default_scope { includes(association_name) }
|
14
14
|
end
|
15
15
|
|
@@ -9,7 +9,7 @@ module Wakari
|
|
9
9
|
|
10
10
|
module ClassMethods
|
11
11
|
def acts_as_meta_class(translation_class, full_association_name, options)
|
12
|
-
has_many full_association_name, :class_name => translation_class.name, :inverse_of => :meta, :order => :created_at, :foreign_key => :meta_id
|
12
|
+
has_many full_association_name, :class_name => "::Object::#{translation_class.name}", :inverse_of => :meta, :order => :created_at, :foreign_key => :meta_id
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -39,8 +39,8 @@ module Wakari
|
|
39
39
|
def acts_as_translation_class(content_class, association_name, meta_class, full_association_name, options)
|
40
40
|
has_locale! *Array.wrap(options[:locales])#, :accessible => false
|
41
41
|
|
42
|
-
belongs_to :content, :class_name => content_class.name, :inverse_of => association_name, :counter_cache => :"#{association_name}_count"
|
43
|
-
belongs_to :meta, :class_name => meta_class.name, :inverse_of => full_association_name, :counter_cache => :wakari_used
|
42
|
+
belongs_to :content, :class_name => "::Object::#{content_class.name}", :inverse_of => association_name, :counter_cache => :"#{association_name}_count"
|
43
|
+
belongs_to :meta, :class_name => "::Object::#{meta_class.name}", :inverse_of => full_association_name, :counter_cache => :wakari_used
|
44
44
|
|
45
45
|
self._meta_attributes =
|
46
46
|
if meta_class < Wakari::Meta::Text || meta_class < Wakari::Meta::String
|
data/lib/wakari/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wakari
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gaigo
|