lolita-translation 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc20174ac98f712d9ee2a4f45973cc8cca9e0286
4
- data.tar.gz: cc14813d6a22f407017347e9e4cb467368e859c2
3
+ metadata.gz: eacac6197ace9e935ccd39162554799972f60d55
4
+ data.tar.gz: 05a8129d30433e5ac38c22adcfa4abf5a5b980bc
5
5
  SHA512:
6
- metadata.gz: b90088d1f9c8cbc0b7ef7e296da256847a64c39ca0132dcad28e1198fc26cb5ba6282ec22cc9e8757e8b5a89765112261a90e5a77f7cbadbd5956e293170c4e2
7
- data.tar.gz: b1bcdf5e21767e1fb38c6d476fa9570619be40c5e47bb8829b24061753e5b6793d918bd4b10a503faac03681ef36b6eadf411e7f3931cc0de3413b2d29ee2565
6
+ metadata.gz: 078b5e8431713ed62eaefbe7495963ff9637a72e5c990b3c3a14631a4de49a0137eec45add6f43b153b75ae9a5be0d1a34c4ebc8a3bccb8a695816ee9c95c024
7
+ data.tar.gz: 31cb44081b8aa06e8ca46afe54d677bda2c234276d71da8726759726bb65b70a14cc26efe6ac430d43347dff761ffaa668d7a25e3f78c73c0d7e91e6a1a43fbe
data/Gemfile CHANGED
@@ -3,11 +3,11 @@ source "http://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  group :test do
6
- gem 'rails', '~> 3.2.12'
6
+ gem 'rails', '~> 3.2.14'
7
7
  gem 'rspec-rails', '~> 2.14'
8
8
  gem 'ffaker', '~> 1.16.2'
9
9
  gem 'capybara', '~> 2.1'
10
- gem 'selenium-webdriver', '~> 2.33.0'
10
+ gem 'selenium-webdriver', '~> 2.34.0'
11
11
  gem 'sqlite3', '~> 1.3.7'
12
12
  gem 'byebug'
13
13
  gem 'cover_me'
@@ -3,7 +3,7 @@ require 'lolita'
3
3
 
4
4
 
5
5
  module Lolita
6
- # Lolita::Translation is module for all classes and module for data translation in Lolita.
6
+ # Lolita::Translation is module for all classes and module for data translation in Lolita.
7
7
  # It have #locales method, that is is used to get all configured locales or all available locales.
8
8
  module Translation
9
9
 
@@ -46,7 +46,7 @@ module Lolita
46
46
  def self.load_rails_engine!
47
47
  require 'lolita-translation/rails'
48
48
  end
49
-
49
+
50
50
  end
51
51
  end
52
52
 
@@ -11,7 +11,6 @@ module Lolita
11
11
  end
12
12
 
13
13
  def build
14
- add_ar_klass_class_methods
15
14
  add_ar_klass_associations
16
15
  add_ar_klass_validations
17
16
  call_base_klass_class_methods
@@ -20,6 +19,7 @@ module Lolita
20
19
 
21
20
  def override_klass_attributes(attributes)
22
21
  add_ar_klass_attr_accessible(attributes + default_attributes)
22
+ add_ar_klass_table_name(self.table_name)
23
23
  expanded_attributes = attributes.inject({}){|hsh,attribute|
24
24
  hsh[attribute] = attribute
25
25
  hsh
@@ -34,8 +34,16 @@ module Lolita
34
34
  end
35
35
 
36
36
  def add_ar_klass_attr_accessible attributes
37
+ ar_translation_builder = self
37
38
  klass.class_eval do
38
39
  attr_accessible :locale, *attributes
40
+ self.table_name = ar_translation_builder.table_name
41
+ end
42
+ end
43
+
44
+ def add_ar_klass_table_name name
45
+ klass.class_eval do
46
+ self.table_name = name
39
47
  end
40
48
  end
41
49
 
@@ -63,15 +71,6 @@ module Lolita
63
71
  end
64
72
  end
65
73
 
66
- def add_ar_klass_class_methods
67
- ar_translation_builder = self
68
- klass.singleton_class.instance_eval do
69
- define_method(:table_name) do
70
- ar_translation_builder.table_name
71
- end
72
- end
73
- end
74
-
75
74
  def call_base_klass_class_methods
76
75
  if self.configuration
77
76
  base_klass.has_many(translations_association_name, {
@@ -3,7 +3,7 @@ module Lolita
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 7
6
- PATCH = 0
6
+ PATCH = 1
7
7
  BUILD = nil
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -29,4 +29,4 @@ module Lolita
29
29
  end
30
30
  end
31
31
  end
32
- end
32
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lolita-translation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ITHouse (Latvia) and Arturs Meisters
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-10 00:00:00.000000000 Z
11
+ date: 2013-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lolita
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.0.3
126
+ rubygems_version: 2.0.4
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Lolita extension that add multilanguate support to Lolita.