lolita-translation 0.2.5 → 0.2.6

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.5
1
+ 0.2.6
@@ -197,7 +197,6 @@ module Lolita
197
197
  def define_translation_class name, attrs
198
198
  klass = name.constantize rescue nil
199
199
  adapter = Lolita::DBI::Base.create(self)
200
-
201
200
  unless klass
202
201
  klass = create_class(name, Object, get_orm_class(adapter)) do
203
202
  if adapter.dbi.adapter_name == :mongoid
@@ -209,6 +208,17 @@ module Lolita
209
208
 
210
209
  cattr_accessor :translate_attrs, :master_id
211
210
 
211
+ # before friendly_id 4.x
212
+ if adapter.klass.respond_to?(:uses_friendly_id?) && adapter.klass.send(:uses_friendly_id?)
213
+ parent_config = adapter.klass.friendly_id_config
214
+ has_friendly_id parent_config.method,
215
+ :allow_nil => parent_config.allow_nil,
216
+ :approximate_ascii => parent_config.approximate_ascii,
217
+ :max_length => parent_config.max_length,
218
+ :reserved_words => parent_config.reserved_words,
219
+ :use_slug => parent_config.use_slug
220
+ end
221
+
212
222
  # override validate to vaidate only translate fields from master Class
213
223
  def validate
214
224
  item = self.class.name.sub('Translation','').constantize.new(self.attributes.clone.delete_if{|k,_| !self.class.translate_attrs.include?(k.to_sym)})
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "lolita-translation"
8
- s.version = "0.2.5"
8
+ s.version = "0.2.6"
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-09-09"
12
+ s.date = "2011-10-04"
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.5
4
+ version: 0.2.6
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-09-09 00:00:00.000000000Z
14
+ date: 2011-10-04 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
18
- requirement: &83547910 !ruby/object:Gem::Requirement
18
+ requirement: &80397510 !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: *83547910
26
+ version_requirements: *80397510
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: lolita
29
- requirement: &83547490 !ruby/object:Gem::Requirement
29
+ requirement: &80397150 !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: *83547490
37
+ version_requirements: *80397150
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: shoulda
40
- requirement: &83547050 !ruby/object:Gem::Requirement
40
+ requirement: &80396860 !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: *83547050
48
+ version_requirements: *80396860
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: bundler
51
- requirement: &83546570 !ruby/object:Gem::Requirement
51
+ requirement: &80279600 !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: *83546570
59
+ version_requirements: *80279600
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: jeweler
62
- requirement: &83546120 !ruby/object:Gem::Requirement
62
+ requirement: &80278880 !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: *83546120
70
+ version_requirements: *80278880
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rcov
73
- requirement: &83545510 !ruby/object:Gem::Requirement
73
+ requirement: &80278570 !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: *83545510
81
+ version_requirements: *80278570
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: -857802353
131
+ hash: -431362259
132
132
  required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  none: false
134
134
  requirements: