lolita-translation 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
@@ -88,11 +88,11 @@ module Lolita
88
88
  :writer => false,
89
89
  :nil => ''
90
90
  }.merge(attrs.extract_options!)
91
- options.assert_valid_keys([:fallback, :reader, :writer, :nil])
91
+ options.assert_valid_keys([:fallback, :reader, :writer, :nil,:table_name])
92
92
  self.extend(Lolita::Translation::ClassMethods)
93
93
  self.class_eval do
94
94
  translation_class_name = "#{self.name}Translation"
95
- translation_class = self.define_translation_class(translation_class_name, attrs)
95
+ translation_class = self.define_translation_class(translation_class_name, attrs,options)
96
96
  belongs_to = self.name.demodulize.underscore.to_sym
97
97
 
98
98
  write_inheritable_attribute :has_translations_options, options
@@ -194,7 +194,7 @@ module Lolita
194
194
  end
195
195
 
196
196
  # defines "ModelNameTranslation" if it's not defined manualy
197
- def define_translation_class name, attrs
197
+ def define_translation_class name, attrs, options = {}
198
198
  klass = name.constantize rescue nil
199
199
  adapter = Lolita::DBI::Base.create(self)
200
200
  unless klass
@@ -204,7 +204,7 @@ module Lolita
204
204
  end
205
205
  # set's real table name
206
206
  translation_adapter = Lolita::DBI::Base.create(self)
207
- translation_adapter.collection_name = adapter.collection_name.to_s.singularize + "_translation"
207
+ translation_adapter.collection_name = options[:table_name] || adapter.collection_name.to_s.singularize + "_translation"
208
208
 
209
209
  cattr_accessor :translate_attrs, :master_id
210
210
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "lolita-translation"
8
- s.version = "0.2.6"
8
+ s.version = "0.2.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["ITHouse", "Gatis Tomsons", "Arturs Meisters"]
12
- s.date = "2011-10-04"
12
+ s.date = "2011-10-05"
13
13
  s.description = "Translates models in Lolita"
14
14
  s.email = "support@ithouse.lv"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lolita-translation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-10-04 00:00:00.000000000Z
14
+ date: 2011-10-05 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
18
- requirement: &80397510 !ruby/object:Gem::Requirement
18
+ requirement: &79686440 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 3.1.0
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *80397510
26
+ version_requirements: *79686440
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: lolita
29
- requirement: &80397150 !ruby/object:Gem::Requirement
29
+ requirement: &79686070 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 3.2.0.rc.3
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *80397150
37
+ version_requirements: *79686070
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: shoulda
40
- requirement: &80396860 !ruby/object:Gem::Requirement
40
+ requirement: &79685760 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :development
47
47
  prerelease: false
48
- version_requirements: *80396860
48
+ version_requirements: *79685760
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: bundler
51
- requirement: &80279600 !ruby/object:Gem::Requirement
51
+ requirement: &79569120 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ~>
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: 1.0.0
57
57
  type: :development
58
58
  prerelease: false
59
- version_requirements: *80279600
59
+ version_requirements: *79569120
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: jeweler
62
- requirement: &80278880 !ruby/object:Gem::Requirement
62
+ requirement: &79568270 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: 1.5.2
68
68
  type: :development
69
69
  prerelease: false
70
- version_requirements: *80278880
70
+ version_requirements: *79568270
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rcov
73
- requirement: &80278570 !ruby/object:Gem::Requirement
73
+ requirement: &79567950 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,7 +78,7 @@ dependencies:
78
78
  version: '0'
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *80278570
81
+ version_requirements: *79567950
82
82
  description: Translates models in Lolita
83
83
  email: support@ithouse.lv
84
84
  executables: []
@@ -128,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  segments:
130
130
  - 0
131
- hash: -431362259
131
+ hash: -823012079
132
132
  required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  none: false
134
134
  requirements: