has_translations 1.0.0 → 1.1.0

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: c6e03b94dfeed7b80f2db6b67d982f0c3a2c43b7
4
- data.tar.gz: 993afc8d7892e75345ac2facd51d5b7c3f0c792f
3
+ metadata.gz: 90c1cd38c3c0b3dd760c062f77d2f73fe67cd1de
4
+ data.tar.gz: 3f79739a23be82fe00dd03c61058e5a21502a560
5
5
  SHA512:
6
- metadata.gz: 9ec0bc9aba1e8e67bdce71561c5de9e284b601faa0c47fb936c36785aa773f8f98406556c5ddd534d427380f68f05b56f23ff6b7a62c16da3459e32e482257ba
7
- data.tar.gz: 635b501602a37de402ca56b8badf2c4c1dbdc608626308c9c9663f9e4c67eed9c0eaf0dfb147dbed99ca83f06194c0ce921d8740973f46b3ecb7107f925d048a
6
+ metadata.gz: 6685cbcc8b660f95b509764e9c21d847be5feb4fded8b96dadf0787d6e3b136198b8cb0ae003cb08ebb332de01512598480d85d4e7d897a84afe1ae1c04bb412
7
+ data.tar.gz: c9d71e17d3ec0f84e6ea271666422c0a90c837f6877ccd971e4d1dbb90e2c12777790c72f3756802656d1845937dbf50c66d288afe7097537ee4b6a2d12d8bb6
data/.gitignore CHANGED
@@ -5,4 +5,4 @@ pkg/*
5
5
  test.log
6
6
  test/has_translations_plugin.sqlite3.db
7
7
  test/debug.log
8
-
8
+ Gemfile.lock
data/.travis.yml CHANGED
@@ -1,21 +1,16 @@
1
1
  rvm:
2
- - ree
3
2
  - 1.9.3
4
3
  - 2.0.0
5
-
4
+ - 2.1.7
5
+ - 2.2.3
6
6
  before_install:
7
- - "gem install bundler -v=1.3.0"
7
+ - "gem install bundler -v=1.10.6"
8
8
  before_script:
9
9
  - "bundle install"
10
-
11
10
  script: "bundle exec rake test"
12
-
13
11
  gemfile:
14
- - gemfiles/3.1.gemfile
15
12
  - gemfiles/3.2.gemfile
16
13
  - gemfiles/4.0.gemfile
17
-
18
- matrix:
19
- exclude:
20
- - rvm: ree
21
- gemfile: gemfiles/4.0.gemfile
14
+ - gemfiles/4.1.gemfile
15
+ - gemfiles/4.2.gemfile
16
+ cache: bundler
data/Appraisals CHANGED
@@ -1,11 +1,15 @@
1
- appraise '3.1' do
2
- gem 'rails', '~> 3.1.6'
3
- end
4
-
5
1
  appraise '3.2' do
6
- gem 'rails', '~> 3.2.6'
2
+ gem 'rails', '~> 3.2.22'
7
3
  end
8
4
 
9
5
  appraise '4.0' do
10
- gem 'rails', '4.0.0'
11
- end
6
+ gem 'rails', '4.0.13'
7
+ end
8
+
9
+ appraise '4.1' do
10
+ gem 'rails', '4.1.13'
11
+ end
12
+
13
+ appraise '4.2' do
14
+ gem 'rails', '4.2.4'
15
+ end
data/Gemfile.lock CHANGED
@@ -1,42 +1,44 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- has_translations (1.0.0)
5
- activerecord (>= 3.1.0)
6
- activesupport (>= 3.1.0)
4
+ has_translations (1.1.0)
5
+ activerecord (>= 3.2.0)
6
+ activesupport (>= 3.2.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (4.0.0)
12
- activesupport (= 4.0.0)
13
- builder (~> 3.1.0)
14
- activerecord (4.0.0)
15
- activemodel (= 4.0.0)
16
- activerecord-deprecated_finders (~> 1.0.2)
17
- activesupport (= 4.0.0)
18
- arel (~> 4.0.0)
19
- activerecord-deprecated_finders (1.0.3)
20
- activesupport (4.0.0)
21
- i18n (~> 0.6, >= 0.6.4)
22
- minitest (~> 4.2)
23
- multi_json (~> 1.3)
24
- thread_safe (~> 0.1)
25
- tzinfo (~> 0.3.37)
26
- appraisal (0.5.2)
11
+ activemodel (4.2.4)
12
+ activesupport (= 4.2.4)
13
+ builder (~> 3.1)
14
+ activerecord (4.2.4)
15
+ activemodel (= 4.2.4)
16
+ activesupport (= 4.2.4)
17
+ arel (~> 6.0)
18
+ activesupport (4.2.4)
19
+ i18n (~> 0.7)
20
+ json (~> 1.7, >= 1.7.7)
21
+ minitest (~> 5.1)
22
+ thread_safe (~> 0.3, >= 0.3.4)
23
+ tzinfo (~> 1.1)
24
+ appraisal (2.1.0)
27
25
  bundler
28
26
  rake
29
- arel (4.0.0)
30
- atomic (1.1.10)
31
- builder (3.1.4)
32
- i18n (0.6.4)
33
- minitest (4.7.5)
34
- multi_json (1.7.7)
35
- rake (10.1.0)
36
- sqlite3 (1.3.7)
37
- thread_safe (0.1.2)
38
- atomic
39
- tzinfo (0.3.37)
27
+ thor (>= 0.14.0)
28
+ arel (6.0.3)
29
+ builder (3.2.2)
30
+ i18n (0.7.0)
31
+ json (1.8.3)
32
+ minitest (5.8.2)
33
+ power_assert (0.2.5)
34
+ rake (10.4.2)
35
+ sqlite3 (1.3.11)
36
+ test-unit (3.1.5)
37
+ power_assert
38
+ thor (0.19.1)
39
+ thread_safe (0.3.5)
40
+ tzinfo (1.2.2)
41
+ thread_safe (~> 0.1)
40
42
 
41
43
  PLATFORMS
42
44
  ruby
@@ -46,3 +48,7 @@ DEPENDENCIES
46
48
  has_translations!
47
49
  rake
48
50
  sqlite3
51
+ test-unit
52
+
53
+ BUNDLED WITH
54
+ 1.10.6
data/README.md CHANGED
@@ -1,18 +1,19 @@
1
- HasTranslations v1.0.0
1
+ HasTranslations
2
2
  ==============================
3
3
 
4
- [![Build Status](https://secure.travis-ci.org/dmitry/has_translations.png?branch=master)](http://travis-ci.org/dmitry/has_translations) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/dmitry/has_translations/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
4
+ [![Build Status](https://secure.travis-ci.org/dmitry/has_translations.png?branch=master)](http://travis-ci.org/dmitry/has_translations)
5
+ [![Gem Version](https://badge.fury.io/rb/has_translations.png)](http://badge.fury.io/rb/has_translations)
5
6
 
6
7
  This simple plugin creates translations for your model.
7
8
  Uses delegation pattern: http://en.wikipedia.org/wiki/Delegation_pattern
8
9
 
9
- Tested with ActiveRecord versions: 3.1.x, 3.2.x, 4.0.x
10
- And tested with ruby 1.8.7 (ree), 1.9.3, 2.0.0
10
+ Tested with ActiveRecord versions: 3.2.x, 4.0.x, 4.1.x, 4.2.x
11
+ And tested with ruby 1.9.3, 2.0.0, 2.1.x, 2.2.x
11
12
 
12
13
  Compatibility
13
14
  =============
14
15
 
15
- This version only support Rails 4.0.x and 3.x.x. For Rails 2.3.x support please get the 0.3.5 version of this gem.
16
+ This version only support Rails 4.x.x and 3.2.x. For Rails 2.3.x support please get the 0.3.5 version of this gem and for Rails 3.1.x get the 1.0.0 of this gem.
16
17
  Plugin support is deprecated in Rails and will be removed soon so this version drop plugin support.
17
18
  To prevent method shadowing between "translations" class method and "translations" relation in models the class
18
19
  method has been renamed has_translations.
@@ -131,4 +132,4 @@ I know three of them:
131
132
  * [translatable_columns](http://github.com/iain/translatable_columns) - different approach: every column have own postfix "_#{locale}" in the same table (sometimes it could be fine).
132
133
 
133
134
 
134
- Copyright (c) 2009-2013 [Dmitry Polushkin], released under the MIT license
135
+ Copyright (c) 2009-2016 [Dmitry Polushkin], released under the MIT license
data/gemfiles/3.2.gemfile CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 3.2.6"
5
+ gem "rails", "~> 3.2.22"
6
6
 
7
- gemspec :path=>"../"
7
+ gemspec :path => "../"
@@ -0,0 +1,108 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ has_translations (1.1.0)
5
+ activerecord (>= 3.2.0)
6
+ activesupport (>= 3.2.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionmailer (3.2.22)
12
+ actionpack (= 3.2.22)
13
+ mail (~> 2.5.4)
14
+ actionpack (3.2.22)
15
+ activemodel (= 3.2.22)
16
+ activesupport (= 3.2.22)
17
+ builder (~> 3.0.0)
18
+ erubis (~> 2.7.0)
19
+ journey (~> 1.0.4)
20
+ rack (~> 1.4.5)
21
+ rack-cache (~> 1.2)
22
+ rack-test (~> 0.6.1)
23
+ sprockets (~> 2.2.1)
24
+ activemodel (3.2.22)
25
+ activesupport (= 3.2.22)
26
+ builder (~> 3.0.0)
27
+ activerecord (3.2.22)
28
+ activemodel (= 3.2.22)
29
+ activesupport (= 3.2.22)
30
+ arel (~> 3.0.2)
31
+ tzinfo (~> 0.3.29)
32
+ activeresource (3.2.22)
33
+ activemodel (= 3.2.22)
34
+ activesupport (= 3.2.22)
35
+ activesupport (3.2.22)
36
+ i18n (~> 0.6, >= 0.6.4)
37
+ multi_json (~> 1.0)
38
+ appraisal (2.1.0)
39
+ bundler
40
+ rake
41
+ thor (>= 0.14.0)
42
+ arel (3.0.3)
43
+ builder (3.0.4)
44
+ erubis (2.7.0)
45
+ hike (1.2.3)
46
+ i18n (0.7.0)
47
+ journey (1.0.4)
48
+ json (1.8.3)
49
+ mail (2.5.4)
50
+ mime-types (~> 1.16)
51
+ treetop (~> 1.4.8)
52
+ mime-types (1.25.1)
53
+ multi_json (1.11.2)
54
+ polyglot (0.3.5)
55
+ power_assert (0.2.5)
56
+ rack (1.4.7)
57
+ rack-cache (1.5.1)
58
+ rack (>= 0.4)
59
+ rack-ssl (1.3.4)
60
+ rack
61
+ rack-test (0.6.3)
62
+ rack (>= 1.0)
63
+ rails (3.2.22)
64
+ actionmailer (= 3.2.22)
65
+ actionpack (= 3.2.22)
66
+ activerecord (= 3.2.22)
67
+ activeresource (= 3.2.22)
68
+ activesupport (= 3.2.22)
69
+ bundler (~> 1.0)
70
+ railties (= 3.2.22)
71
+ railties (3.2.22)
72
+ actionpack (= 3.2.22)
73
+ activesupport (= 3.2.22)
74
+ rack-ssl (~> 1.3.2)
75
+ rake (>= 0.8.7)
76
+ rdoc (~> 3.4)
77
+ thor (>= 0.14.6, < 2.0)
78
+ rake (10.4.2)
79
+ rdoc (3.12.2)
80
+ json (~> 1.4)
81
+ sprockets (2.2.3)
82
+ hike (~> 1.2)
83
+ multi_json (~> 1.0)
84
+ rack (~> 1.0)
85
+ tilt (~> 1.1, != 1.3.0)
86
+ sqlite3 (1.3.11)
87
+ test-unit (3.1.5)
88
+ power_assert
89
+ thor (0.19.1)
90
+ tilt (1.4.1)
91
+ treetop (1.4.15)
92
+ polyglot
93
+ polyglot (>= 0.3.1)
94
+ tzinfo (0.3.45)
95
+
96
+ PLATFORMS
97
+ ruby
98
+
99
+ DEPENDENCIES
100
+ appraisal
101
+ has_translations!
102
+ rails (~> 3.2.22)
103
+ rake
104
+ sqlite3
105
+ test-unit
106
+
107
+ BUNDLED WITH
108
+ 1.10.6
data/gemfiles/4.0.gemfile CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "4.0.0"
5
+ gem "rails", "4.0.13"
6
6
 
7
- gemspec :path=>"../"
7
+ gemspec :path => "../"
@@ -0,0 +1,91 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ has_translations (1.1.0)
5
+ activerecord (>= 3.2.0)
6
+ activesupport (>= 3.2.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionmailer (4.0.13)
12
+ actionpack (= 4.0.13)
13
+ mail (~> 2.5, >= 2.5.4)
14
+ actionpack (4.0.13)
15
+ activesupport (= 4.0.13)
16
+ builder (~> 3.1.0)
17
+ erubis (~> 2.7.0)
18
+ rack (~> 1.5.2)
19
+ rack-test (~> 0.6.2)
20
+ activemodel (4.0.13)
21
+ activesupport (= 4.0.13)
22
+ builder (~> 3.1.0)
23
+ activerecord (4.0.13)
24
+ activemodel (= 4.0.13)
25
+ activerecord-deprecated_finders (~> 1.0.2)
26
+ activesupport (= 4.0.13)
27
+ arel (~> 4.0.0)
28
+ activerecord-deprecated_finders (1.0.4)
29
+ activesupport (4.0.13)
30
+ i18n (~> 0.6, >= 0.6.9)
31
+ minitest (~> 4.2)
32
+ multi_json (~> 1.3)
33
+ thread_safe (~> 0.1)
34
+ tzinfo (~> 0.3.37)
35
+ appraisal (2.1.0)
36
+ bundler
37
+ rake
38
+ thor (>= 0.14.0)
39
+ arel (4.0.2)
40
+ builder (3.1.4)
41
+ erubis (2.7.0)
42
+ i18n (0.7.0)
43
+ mail (2.6.3)
44
+ mime-types (>= 1.16, < 3)
45
+ mime-types (2.6.2)
46
+ minitest (4.7.5)
47
+ multi_json (1.11.2)
48
+ power_assert (0.2.5)
49
+ rack (1.5.5)
50
+ rack-test (0.6.3)
51
+ rack (>= 1.0)
52
+ rails (4.0.13)
53
+ actionmailer (= 4.0.13)
54
+ actionpack (= 4.0.13)
55
+ activerecord (= 4.0.13)
56
+ activesupport (= 4.0.13)
57
+ bundler (>= 1.3.0, < 2.0)
58
+ railties (= 4.0.13)
59
+ sprockets-rails (~> 2.0)
60
+ railties (4.0.13)
61
+ actionpack (= 4.0.13)
62
+ activesupport (= 4.0.13)
63
+ rake (>= 0.8.7)
64
+ thor (>= 0.18.1, < 2.0)
65
+ rake (10.4.2)
66
+ sprockets (3.4.0)
67
+ rack (> 1, < 3)
68
+ sprockets-rails (2.3.3)
69
+ actionpack (>= 3.0)
70
+ activesupport (>= 3.0)
71
+ sprockets (>= 2.8, < 4.0)
72
+ sqlite3 (1.3.11)
73
+ test-unit (3.1.5)
74
+ power_assert
75
+ thor (0.19.1)
76
+ thread_safe (0.3.5)
77
+ tzinfo (0.3.45)
78
+
79
+ PLATFORMS
80
+ ruby
81
+
82
+ DEPENDENCIES
83
+ appraisal
84
+ has_translations!
85
+ rails (= 4.0.13)
86
+ rake
87
+ sqlite3
88
+ test-unit
89
+
90
+ BUNDLED WITH
91
+ 1.10.6
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "4.1.13"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,96 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ has_translations (1.1.0)
5
+ activerecord (>= 3.2.0)
6
+ activesupport (>= 3.2.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionmailer (4.1.13)
12
+ actionpack (= 4.1.13)
13
+ actionview (= 4.1.13)
14
+ mail (~> 2.5, >= 2.5.4)
15
+ actionpack (4.1.13)
16
+ actionview (= 4.1.13)
17
+ activesupport (= 4.1.13)
18
+ rack (~> 1.5.2)
19
+ rack-test (~> 0.6.2)
20
+ actionview (4.1.13)
21
+ activesupport (= 4.1.13)
22
+ builder (~> 3.1)
23
+ erubis (~> 2.7.0)
24
+ activemodel (4.1.13)
25
+ activesupport (= 4.1.13)
26
+ builder (~> 3.1)
27
+ activerecord (4.1.13)
28
+ activemodel (= 4.1.13)
29
+ activesupport (= 4.1.13)
30
+ arel (~> 5.0.0)
31
+ activesupport (4.1.13)
32
+ i18n (~> 0.6, >= 0.6.9)
33
+ json (~> 1.7, >= 1.7.7)
34
+ minitest (~> 5.1)
35
+ thread_safe (~> 0.1)
36
+ tzinfo (~> 1.1)
37
+ appraisal (2.1.0)
38
+ bundler
39
+ rake
40
+ thor (>= 0.14.0)
41
+ arel (5.0.1.20140414130214)
42
+ builder (3.2.2)
43
+ erubis (2.7.0)
44
+ i18n (0.7.0)
45
+ json (1.8.3)
46
+ mail (2.6.3)
47
+ mime-types (>= 1.16, < 3)
48
+ mime-types (2.6.2)
49
+ minitest (5.8.2)
50
+ power_assert (0.2.5)
51
+ rack (1.5.5)
52
+ rack-test (0.6.3)
53
+ rack (>= 1.0)
54
+ rails (4.1.13)
55
+ actionmailer (= 4.1.13)
56
+ actionpack (= 4.1.13)
57
+ actionview (= 4.1.13)
58
+ activemodel (= 4.1.13)
59
+ activerecord (= 4.1.13)
60
+ activesupport (= 4.1.13)
61
+ bundler (>= 1.3.0, < 2.0)
62
+ railties (= 4.1.13)
63
+ sprockets-rails (~> 2.0)
64
+ railties (4.1.13)
65
+ actionpack (= 4.1.13)
66
+ activesupport (= 4.1.13)
67
+ rake (>= 0.8.7)
68
+ thor (>= 0.18.1, < 2.0)
69
+ rake (10.4.2)
70
+ sprockets (3.4.0)
71
+ rack (> 1, < 3)
72
+ sprockets-rails (2.3.3)
73
+ actionpack (>= 3.0)
74
+ activesupport (>= 3.0)
75
+ sprockets (>= 2.8, < 4.0)
76
+ sqlite3 (1.3.11)
77
+ test-unit (3.1.5)
78
+ power_assert
79
+ thor (0.19.1)
80
+ thread_safe (0.3.5)
81
+ tzinfo (1.2.2)
82
+ thread_safe (~> 0.1)
83
+
84
+ PLATFORMS
85
+ ruby
86
+
87
+ DEPENDENCIES
88
+ appraisal
89
+ has_translations!
90
+ rails (= 4.1.13)
91
+ rake
92
+ sqlite3
93
+ test-unit
94
+
95
+ BUNDLED WITH
96
+ 1.10.6
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 3.1.6"
5
+ gem "rails", "4.2.4"
6
6
 
7
- gemspec :path=>"../"
7
+ gemspec :path => "../"
@@ -0,0 +1,121 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ has_translations (1.1.0)
5
+ activerecord (>= 3.2.0)
6
+ activesupport (>= 3.2.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionmailer (4.2.4)
12
+ actionpack (= 4.2.4)
13
+ actionview (= 4.2.4)
14
+ activejob (= 4.2.4)
15
+ mail (~> 2.5, >= 2.5.4)
16
+ rails-dom-testing (~> 1.0, >= 1.0.5)
17
+ actionpack (4.2.4)
18
+ actionview (= 4.2.4)
19
+ activesupport (= 4.2.4)
20
+ rack (~> 1.6)
21
+ rack-test (~> 0.6.2)
22
+ rails-dom-testing (~> 1.0, >= 1.0.5)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
+ actionview (4.2.4)
25
+ activesupport (= 4.2.4)
26
+ builder (~> 3.1)
27
+ erubis (~> 2.7.0)
28
+ rails-dom-testing (~> 1.0, >= 1.0.5)
29
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
30
+ activejob (4.2.4)
31
+ activesupport (= 4.2.4)
32
+ globalid (>= 0.3.0)
33
+ activemodel (4.2.4)
34
+ activesupport (= 4.2.4)
35
+ builder (~> 3.1)
36
+ activerecord (4.2.4)
37
+ activemodel (= 4.2.4)
38
+ activesupport (= 4.2.4)
39
+ arel (~> 6.0)
40
+ activesupport (4.2.4)
41
+ i18n (~> 0.7)
42
+ json (~> 1.7, >= 1.7.7)
43
+ minitest (~> 5.1)
44
+ thread_safe (~> 0.3, >= 0.3.4)
45
+ tzinfo (~> 1.1)
46
+ appraisal (2.1.0)
47
+ bundler
48
+ rake
49
+ thor (>= 0.14.0)
50
+ arel (6.0.3)
51
+ builder (3.2.2)
52
+ erubis (2.7.0)
53
+ globalid (0.3.6)
54
+ activesupport (>= 4.1.0)
55
+ i18n (0.7.0)
56
+ json (1.8.3)
57
+ loofah (2.0.3)
58
+ nokogiri (>= 1.5.9)
59
+ mail (2.6.3)
60
+ mime-types (>= 1.16, < 3)
61
+ mime-types (2.6.2)
62
+ mini_portile (0.6.2)
63
+ minitest (5.8.2)
64
+ nokogiri (1.6.6.2)
65
+ mini_portile (~> 0.6.0)
66
+ power_assert (0.2.5)
67
+ rack (1.6.4)
68
+ rack-test (0.6.3)
69
+ rack (>= 1.0)
70
+ rails (4.2.4)
71
+ actionmailer (= 4.2.4)
72
+ actionpack (= 4.2.4)
73
+ actionview (= 4.2.4)
74
+ activejob (= 4.2.4)
75
+ activemodel (= 4.2.4)
76
+ activerecord (= 4.2.4)
77
+ activesupport (= 4.2.4)
78
+ bundler (>= 1.3.0, < 2.0)
79
+ railties (= 4.2.4)
80
+ sprockets-rails
81
+ rails-deprecated_sanitizer (1.0.3)
82
+ activesupport (>= 4.2.0.alpha)
83
+ rails-dom-testing (1.0.7)
84
+ activesupport (>= 4.2.0.beta, < 5.0)
85
+ nokogiri (~> 1.6.0)
86
+ rails-deprecated_sanitizer (>= 1.0.1)
87
+ rails-html-sanitizer (1.0.2)
88
+ loofah (~> 2.0)
89
+ railties (4.2.4)
90
+ actionpack (= 4.2.4)
91
+ activesupport (= 4.2.4)
92
+ rake (>= 0.8.7)
93
+ thor (>= 0.18.1, < 2.0)
94
+ rake (10.4.2)
95
+ sprockets (3.4.0)
96
+ rack (> 1, < 3)
97
+ sprockets-rails (2.3.3)
98
+ actionpack (>= 3.0)
99
+ activesupport (>= 3.0)
100
+ sprockets (>= 2.8, < 4.0)
101
+ sqlite3 (1.3.11)
102
+ test-unit (3.1.5)
103
+ power_assert
104
+ thor (0.19.1)
105
+ thread_safe (0.3.5)
106
+ tzinfo (1.2.2)
107
+ thread_safe (~> 0.1)
108
+
109
+ PLATFORMS
110
+ ruby
111
+
112
+ DEPENDENCIES
113
+ appraisal
114
+ has_translations!
115
+ rails (= 4.2.4)
116
+ rake
117
+ sqlite3
118
+ test-unit
119
+
120
+ BUNDLED WITH
121
+ 1.10.6
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "has_translations/version"
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'has_translations/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'has_translations'
@@ -20,9 +20,10 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.license = 'MIT'
22
22
 
23
- s.add_dependency 'activesupport', '>= 3.1.0'
24
- s.add_dependency 'activerecord', '>= 3.1.0'
23
+ s.add_dependency 'activesupport', '>= 3.2.0'
24
+ s.add_dependency 'activerecord', '>= 3.2.0'
25
25
  s.add_development_dependency 'sqlite3'
26
26
  s.add_development_dependency 'appraisal'
27
27
  s.add_development_dependency 'rake'
28
+ s.add_development_dependency 'test-unit'
28
29
  end
@@ -19,7 +19,7 @@ class TranslationForGenerator < ActiveRecord::Generators::Base
19
19
  template 'model.rb.erb', File.join('app/models', class_path, "#{file_name}.rb")
20
20
  end
21
21
 
22
- def create_migration
22
+ def create_translations_migration
23
23
  migration_template 'migration.rb.erb', "db/migrate/create_#{table_name}"
24
24
  end
25
25
 
@@ -10,19 +10,28 @@ module HasTranslations
10
10
  def has_translations(*attrs)
11
11
  new_options = attrs.extract_options!
12
12
  options = {
13
- :fallback => false,
14
- :reader => true,
15
- :writer => false,
16
- :nil => '',
17
- #:inverse_of => self.model_name.singular.to_sym,
18
- :autosave => new_options[:writer],
19
- :translation_class => nil
13
+ fallback: false,
14
+ reader: true,
15
+ writer: false,
16
+ nil: '',
17
+ autosave: new_options[:writer],
18
+ translation_class: nil
20
19
  }.merge(new_options)
21
20
 
22
- translation_class_name = options[:translation_class].try(:name) || "#{self.model_name}Translation"
21
+ translation_class_name = options[:translation_class].try(:name) || "#{self.model_name}Translation"
23
22
  options[:translation_class] ||= translation_class_name.constantize
24
23
 
25
- options.assert_valid_keys([:fallback, :reader, :writer, :nil, :inverse_of, :autosave, :translation_class])
24
+ options.assert_valid_keys(
25
+ [
26
+ :fallback,
27
+ :reader,
28
+ :writer,
29
+ :nil,
30
+ :inverse_of,
31
+ :autosave,
32
+ :translation_class
33
+ ]
34
+ )
26
35
 
27
36
  belongs_to = self.model_name.to_s.demodulize.underscore.to_sym
28
37
 
@@ -30,10 +39,19 @@ module HasTranslations
30
39
  self.has_translations_options = options
31
40
 
32
41
  # associations, validations and scope definitions
33
- has_many :translations, :class_name => translation_class_name, :dependent => :destroy, :autosave => options[:autosave], :inverse_of => options[:inverse_of]
34
- options[:translation_class].belongs_to belongs_to
35
- options[:translation_class].validates_presence_of :locale
36
- options[:translation_class].validates_uniqueness_of :locale, :scope => :"#{belongs_to}_id"
42
+ options[:translation_class].belongs_to(belongs_to)
43
+ has_many(
44
+ :translations,
45
+ class_name: translation_class_name,
46
+ dependent: :destroy,
47
+ autosave: options[:autosave],
48
+ inverse_of: options[:inverse_of]
49
+ )
50
+ options[:translation_class].validates(
51
+ :locale,
52
+ presence: true,
53
+ uniqueness: {scope: :"#{belongs_to}_id"}
54
+ )
37
55
 
38
56
  # Optionals delegated readers
39
57
  if options[:reader]
@@ -60,7 +78,6 @@ module HasTranslations
60
78
  end
61
79
  end
62
80
  end
63
-
64
81
  end
65
82
  end
66
83
 
@@ -1,3 +1,3 @@
1
1
  module HasTranslations
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,83 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_translations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Polushkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-31 00:00:00.000000000 Z
11
+ date: 2015-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.0
19
+ version: 3.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.1.0
26
+ version: 3.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.0
33
+ version: 3.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.0
40
+ version: 3.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: appraisal
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: test-unit
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
97
  description: Create translations for your ActiveRecord models. Uses delegate pattern.
@@ -88,17 +102,22 @@ executables: []
88
102
  extensions: []
89
103
  extra_rdoc_files: []
90
104
  files:
91
- - .gitignore
92
- - .travis.yml
105
+ - ".gitignore"
106
+ - ".travis.yml"
93
107
  - Appraisals
94
108
  - Gemfile
95
109
  - Gemfile.lock
96
110
  - MIT-LICENSE
97
111
  - README.md
98
112
  - Rakefile
99
- - gemfiles/3.1.gemfile
100
113
  - gemfiles/3.2.gemfile
114
+ - gemfiles/3.2.gemfile.lock
101
115
  - gemfiles/4.0.gemfile
116
+ - gemfiles/4.0.gemfile.lock
117
+ - gemfiles/4.1.gemfile
118
+ - gemfiles/4.1.gemfile.lock
119
+ - gemfiles/4.2.gemfile
120
+ - gemfiles/4.2.gemfile.lock
102
121
  - has_translations.gemspec
103
122
  - lib/generators/templates/migration.rb.erb
104
123
  - lib/generators/templates/model.rb.erb
@@ -120,17 +139,17 @@ require_paths:
120
139
  - lib
121
140
  required_ruby_version: !ruby/object:Gem::Requirement
122
141
  requirements:
123
- - - '>='
142
+ - - ">="
124
143
  - !ruby/object:Gem::Version
125
144
  version: '0'
126
145
  required_rubygems_version: !ruby/object:Gem::Requirement
127
146
  requirements:
128
- - - '>='
147
+ - - ">="
129
148
  - !ruby/object:Gem::Version
130
149
  version: '0'
131
150
  requirements: []
132
151
  rubyforge_project: has_translations
133
- rubygems_version: 2.0.3
152
+ rubygems_version: 2.4.8
134
153
  signing_key:
135
154
  specification_version: 4
136
155
  summary: Create translations for your ActiveRecord models.