localizable_model 0.5.1 → 0.5.2

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: 61eff75efa97021ace73b94176b38a4eaa6d439d
4
- data.tar.gz: 901ec725f4d1f6abcf0115651a7186a5482f8494
3
+ metadata.gz: b6117f00c6fec1025aa330022a84f21cad2eece0
4
+ data.tar.gz: f9902eea37e398d8ed818d0ce201197875ca73cc
5
5
  SHA512:
6
- metadata.gz: b03e6e64f4fc25a221ed56cf7e019839ad4b958c63d1ced63b4f6f28d0683434f157a87bed79dda1a3ca4fb5cc71d7cefbad634426141e97b9307716632d238e
7
- data.tar.gz: 5ba7f3294c1b506afbe9710bcef488f9aefe9609530555321a713c7b6beda04074b1c68dc96e86af71f51b2c4e2f299c2726fe42be0d7884d5e690d11ef60649
6
+ metadata.gz: d60c8b41363ce53ebadf021d3d810b14dd4ebdbdebe5c141a2644ea0e8b35a4f375f4efd2acb2ff5177d9d4b56467625202560977dd90e937fecda88bf145481
7
+ data.tar.gz: f3e8a3c0481c3f6f89b6f1f9f3ce5092b932706af78e983b90a2600881ef9eb971706313506772dd6342d9e9dc532f0a4484f6daaac75445bcb93327c6c4e2fd
@@ -10,11 +10,20 @@ module LocalizableModel
10
10
 
11
11
  def localize(locale)
12
12
  @locale = locale
13
+ localize_records if loaded?
13
14
  self
14
15
  end
15
16
 
16
- def to_a
17
- super.map { |record| record.localize(@locale) }
17
+ def load
18
+ super
19
+ localize_records
20
+ self
21
+ end
22
+
23
+ protected
24
+
25
+ def localize_records
26
+ @records.each { |r| r.localize!(@locale) }
18
27
  end
19
28
  end
20
29
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module LocalizableModel
4
- VERSION = "0.5.1".freeze unless LocalizableModel.const_defined?("VERSION")
4
+ VERSION = "0.5.2".freeze unless LocalizableModel.const_defined?("VERSION")
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localizable_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inge Jørgensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-01 00:00:00.000000000 Z
11
+ date: 2016-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2