lolita-translation 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,13 +36,16 @@ module Lolita
36
36
  nested_form.expandable = false
37
37
  nested_form.field_style = :normal
38
38
  nested_form.fields = fields_for_translation_nested_form(nested_form)
39
+ if tab.dbi.klass.respond_to?(:lolita_translations_nested_form_builder)
40
+ nested_form.builder= tab.dbi.klass.lolita_translations_nested_form_builder
41
+ end
39
42
  nested_form
40
43
  end
41
44
 
42
45
  def fields_for_translation_nested_form(nested_form)
43
46
  t_attributes = dbi_klass_translation_attributes
44
- t_fields = tab.fields.reject do|field|
45
- !t_attributes.include?(field.name.to_sym)
47
+ t_fields = tab.fields.select do|field|
48
+ t_attributes.include?(field.name.to_sym) && field.dbi == tab.dbi
46
49
  end
47
50
  t_fields << Lolita::Configuration::Factory::Field.add(nested_form.dbi,:locale,:string, :builder => :hidden)
48
51
  t_fields
@@ -33,11 +33,11 @@ module Lolita
33
33
  end
34
34
 
35
35
  def change_table
36
- removed_columns.inject(false) do |result,attribute|
36
+ any_column_removed = removed_columns.inject(false) do |result,attribute|
37
37
  ActiveRecord::Migration.remove_column(config.table_name, attribute)
38
38
  true
39
- end ||
40
- config.attributes.inject(false) do |result, attribute|
39
+ end
40
+ any_column_added = config.attributes.inject(false) do |result, attribute|
41
41
  if !translations_column(attribute)
42
42
  if col = column(attribute)
43
43
  ActiveRecord::Migration.add_column(config.table_name, attribute, col.type)
@@ -46,6 +46,7 @@ module Lolita
46
46
  end
47
47
  result
48
48
  end
49
+ any_column_added || any_column_removed
49
50
  end
50
51
 
51
52
  def add_indexes
@@ -3,7 +3,7 @@ module Lolita
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 6
6
- PATCH = 1
6
+ PATCH = 2
7
7
  BUILD = nil
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
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.6.1
4
+ version: 0.6.2
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: 2012-09-04 00:00:00.000000000 Z
12
+ date: 2012-09-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: lolita
@@ -265,7 +265,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
265
265
  version: '0'
266
266
  segments:
267
267
  - 0
268
- hash: 503000546327852953
268
+ hash: 4135482016566657998
269
269
  required_rubygems_version: !ruby/object:Gem::Requirement
270
270
  none: false
271
271
  requirements:
@@ -274,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
274
  version: '0'
275
275
  segments:
276
276
  - 0
277
- hash: 503000546327852953
277
+ hash: 4135482016566657998
278
278
  requirements: []
279
279
  rubyforge_project:
280
280
  rubygems_version: 1.8.24