globalize 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +14 -6
- data/CHANGELOG.md +69 -0
- data/CONTRIBUTING.md +37 -0
- data/Gemfile.lock +34 -69
- data/lib/globalize.rb +0 -1
- data/lib/globalize/active_record/act_macro.rb +0 -11
- data/lib/globalize/version.rb +1 -1
- metadata +98 -50
- data/lib/globalize/versioning.rb +0 -5
- data/lib/globalize/versioning/paper_trail.rb +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZjA4YjdiYjFmODI5ZjE4ZjVkMWU5NDRjOTZhNDRmODc1MDQwMzdmOQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YTY3NTk5N2ZjY2E4ODFiOGVjYTI2OGE0YzkxODMzOGU3OTU3OTA2MQ==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
Yzg0MWI0YTQzZTMwODMzZTdhMGZjYTZkZjJiMjQ0OTFlYjhjNWY5MzVlMTNi
|
10
|
+
N2U3NTg1NmU3YWE3ZjAwMjJjNmNmMDM3NmYyNzU0ZTZiMTFiMjU0MTZkNzFi
|
11
|
+
MmY3OTBhOGYwODIxNzgwYWU4NWRkY2Y4OTRhOWQyYWMyMDMzZmM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OGE1NGU3NjY0MzRlZWJiYzU4OTRiN2NkMWRjOTlmMzAxMTUyYzkyMjgzMmM2
|
14
|
+
YTM0MWE1ZWRiYWQ5ZjViNDhhOTQ0MzljN2JkNjE4OTFjN2Y0YzU2YmI5OWRi
|
15
|
+
MjA1ZWFiYzJkZGU0YTkwZjc1ZDY1YWMxMTE5OTJhNGZmZWYyYzE=
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# Globalize Changelog
|
2
|
+
|
3
|
+
## 4.0.0 (2014-1-4)
|
4
|
+
* Extract all versioning-related code to separate [globalize-versioning](https://github.com/globalize/globalize-versioning) gem.
|
5
|
+
|
6
|
+
## 4.0.0.alpha.5 (2014-1-4)
|
7
|
+
* Fix issue where globalize breaks has_many through when model called with `where` (thanks [Paul McMahon](https://github.com/pwim)).
|
8
|
+
* Modify dup so that translations are copied, and remove custom clone code to conform to Rails/AR semantics (thanks [Paul McMahon](https://github.com/pwim)).
|
9
|
+
|
10
|
+
## 4.0.0.alpha.4 (2013-12-30)
|
11
|
+
* Add this changelog.
|
12
|
+
* Add contributing guidelines.
|
13
|
+
* Group options into more structured methods in act_macro.rb.
|
14
|
+
* Remove dynamic finder code from globalize3, no longer used in AR4.
|
15
|
+
* Get hash of translated attributes by calling attribute on model, not translation.
|
16
|
+
* Define translation readers/writers in separate methods.
|
17
|
+
* Test against AR 4.1 and AR 4.0.
|
18
|
+
* Switch to minitest-reporters for colouring output from minitest.
|
19
|
+
* Remove find_or_instantiator_by_attributes which is no longer used in AR4.
|
20
|
+
* Set I18n.available_locales in tests to avoid deprecation message.
|
21
|
+
* Reorganize specs into describe blocks to clarify object of specs.
|
22
|
+
|
23
|
+
## 4.0.0.alpha.3 (2013-12-18)
|
24
|
+
|
25
|
+
* Move ActiveRecord::Relation#where_values_hash patch into globalize relation class to avoid monkeypatching.
|
26
|
+
* Add Code Climate Score (thanks [BrandonMathis](https://github.com/BrandonMathis)).
|
27
|
+
* Query using Globalize.fallbacks rather than locale only when fetching a record (thanks [@huoxito](https://github.com/huoxito)).
|
28
|
+
* Use a module (QueryMethods) rather than a class for overriding functionality of ActiveRecord::Relation.
|
29
|
+
* Use ActiveRecord::Relation#extending! to extend ActiveRecord::Base#relation with QueryMethods, works with associations as well.
|
30
|
+
|
31
|
+
## 4.0.0.alpha.2 (2013-10-24)
|
32
|
+
|
33
|
+
* Add license to gemspec.
|
34
|
+
* Update references to ActiveRecord 3 -> ActiveRecord.
|
35
|
+
* Replace references to globalize3 with globalize and remove references to ActiveRecord 3.x.
|
36
|
+
* Document `3-0-stable` branch in readme.
|
37
|
+
* Convert test syntax to MiniTest::Spec.
|
38
|
+
* Extract easy accessors functionality, moved to new [globalize-accessors](https://github.com/globalize/globalize-accessors) gem.
|
39
|
+
* Check that `first` is not nil before reloading translations, fixes [#282](https://github.com/globalize/globalize/issues/282).
|
40
|
+
* Duplicate arguments in query finders before modifying them, fixes [#284](https://github.com/globalize/globalize/issues/284).
|
41
|
+
* Add test for `find_or_create_by` with translated attribute.
|
42
|
+
|
43
|
+
## 4.0.0.alpha.1 (2013-10-9)
|
44
|
+
|
45
|
+
* Initial release of Rails 4-compatible gem.
|
46
|
+
|
47
|
+
## 3.0.4 (2014-1-8)
|
48
|
+
* Extract all versioning-related code to separate [globalize-versioning](https://github.com/globalize/globalize-versioning) gem.
|
49
|
+
|
50
|
+
## 3.0.3 (2013-12-26)
|
51
|
+
|
52
|
+
* Ensure that foreign key is always set when saving translations (thanks [Andrew Feng](https://github.com/mingliangfeng)).
|
53
|
+
* Patch I18n to add back I18n.interpolate after it was removed (accidentally?) in v0.5.2 (see [svenfuchs/i18n#232](https://github.com/svenfuchs/i18n/issues/232). Hopefully this patch will be temporary.
|
54
|
+
* Explicitly test compatibility with FriendlyId to avoid issues like [#306](https://github.com/globalize/globalize/issues/306).
|
55
|
+
* Only override ActiveRecord::Base#relation to patch where_values_hash if using AR >= 3.2.1.
|
56
|
+
|
57
|
+
## 3.0.2 (2013-12-07)
|
58
|
+
|
59
|
+
* Alias `ActiveRecord::Base#relation` and include query method overrides as module, fixes [#306](https://github.com/globalize/globalize/issues/306) and [norman/friendly_id#485](https://github.com/norman/friendly_id/issues/485).
|
60
|
+
|
61
|
+
## 3.0.1 (2013-11-07)
|
62
|
+
|
63
|
+
* Move `ActiveRecord::Relation#where_values_hash` patch to Globalize-specific Relation class that inherits from `ActiveRecord::Relation` to fix compatibility issue with Squeel ([#288](https://github.com/globalize/globalize/issues/288)).
|
64
|
+
* Use FriendlyId pattern for overriding `ActiveRecord::Base#relation` to avoid conflict.
|
65
|
+
* Remove `:null => false` condition on reference to parent model in translation table migration, partial fix for [refinery/refinerycms#2450](https://github.com/refinery/refinerycms/issues/2450).
|
66
|
+
|
67
|
+
## 3.0.0 (2013-10-24)
|
68
|
+
|
69
|
+
* Initial release with new version numbering.
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Contributing to Globalize
|
2
|
+
|
3
|
+
Globalize is a community project, and would not be here today if it were not for the support of the community of [contributors](https://github.com/globalize/globalize/graphs/contributors) that have kept it alive and running. Thank you for your support!
|
4
|
+
|
5
|
+
## Bugs
|
6
|
+
|
7
|
+
If you find a bug or something is not working as expected, please search through the [github issues](https://github.com/globalize/globalize/issues) and on [stackoverflow](http://stackoverflow.com/questions/tagged/globalize) first. If you cannot find any answers related to your issue, post a new one and we will try to address it as soon as we can. Note that we prioritize Rails 4 issues (`master` branch) over Rails 3 issues (`3-0-stable` branch).
|
8
|
+
|
9
|
+
If you also have some idea how to fix the bug, then by all means post a pull request (see below).
|
10
|
+
|
11
|
+
## Features
|
12
|
+
|
13
|
+
Have an idea for a new feature? Great! Keep in mind though that we are trying to cut down on non-core functionality in the Globalize core and push it to separate extensions, such as [globalize-accessors](https://github.com/globalize/globalize-accessors). If you are proposing something like this, we would prefer you to create a separate repository and gem for it.
|
14
|
+
|
15
|
+
If however your feature would improve the core functionality of Globalize, please do submit a PR, preferably to the `master` branch.
|
16
|
+
|
17
|
+
## Refactoring
|
18
|
+
|
19
|
+
Have some free time? Help us improve our [code climate score](https://codeclimate.com/github/globalize/globalize) by refactoring the codebase. If the tests still pass and the changes seem reasonable, we will happily merge them. As elsewhere, priority always goes to the Rails/AR 4 series (`master` branch).
|
20
|
+
|
21
|
+
## Documentation
|
22
|
+
|
23
|
+
Globalize needs better documentation. That includes more inline comments explaining clearly what code is doing, as well as reference documentation beyond the [readme](readme.md) -- possibly in the github wiki. Please contact us if you would like to help with documentation.
|
24
|
+
|
25
|
+
## Pull Requests
|
26
|
+
|
27
|
+
Have a bug fix, code improvement or proposed feature? Do the following:
|
28
|
+
|
29
|
+
1. Fork the repository.
|
30
|
+
2. Create your feature branch: `git checkout -b my_new_feature`
|
31
|
+
3. Commit your changes: `git commit -am 'Add some new feature'`
|
32
|
+
4. Push to the branch: `git push origin my_new_feature`
|
33
|
+
5. Submit a pull request.
|
34
|
+
|
35
|
+
For pull requests to Rails/ActiveRecord 4 version of Globalize (v3.x), post to the `master` branch. For pull requests to the Rails/ActiveRecord 3.x version of Globalize (3.x), post to the `3-0-stable` branch.
|
36
|
+
|
37
|
+
When you submit the pull request, Travis CI will run the [test suite](https://travis-ci.org/globalize/globalize) against your branch and will highlight any failures. Unless there is a good reason for it, we do not generally accept pull requests that take Globalize from green to red.
|
data/Gemfile.lock
CHANGED
@@ -1,73 +1,38 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/airblade/paper_trail.git
|
3
|
-
revision: c4e188c27040888515866660bac94740b92a262b
|
4
|
-
branch: master
|
5
|
-
specs:
|
6
|
-
paper_trail (3.0.0)
|
7
|
-
activerecord (>= 3.0, < 5.0)
|
8
|
-
activesupport (>= 3.0, < 5.0)
|
9
|
-
|
10
|
-
GIT
|
11
|
-
remote: git://github.com/bmabey/database_cleaner.git
|
12
|
-
revision: c0c7885466287dcde3dbac195a5f10df306db098
|
13
|
-
branch: master
|
14
|
-
specs:
|
15
|
-
database_cleaner (1.2.0)
|
16
|
-
|
17
1
|
PATH
|
18
2
|
remote: .
|
19
3
|
specs:
|
20
|
-
globalize (
|
21
|
-
activemodel (
|
22
|
-
activerecord (
|
23
|
-
paper_trail (~> 3.0.0.beta)
|
4
|
+
globalize (3.0.3)
|
5
|
+
activemodel (~> 3.0.0)
|
6
|
+
activerecord (~> 3.0.0)
|
24
7
|
|
25
8
|
GEM
|
26
9
|
remote: https://rubygems.org/
|
27
10
|
specs:
|
28
|
-
activemodel (
|
29
|
-
activesupport (=
|
30
|
-
builder (~>
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
activesupport (=
|
35
|
-
arel (~>
|
36
|
-
|
37
|
-
activesupport (
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
thread_safe (~> 0.1)
|
42
|
-
tzinfo (~> 0.3.37)
|
43
|
-
ansi (1.4.3)
|
44
|
-
arel (4.0.1)
|
45
|
-
atomic (1.1.14)
|
46
|
-
builder (3.1.4)
|
47
|
-
coderay (1.1.0)
|
11
|
+
activemodel (3.0.20)
|
12
|
+
activesupport (= 3.0.20)
|
13
|
+
builder (~> 2.1.2)
|
14
|
+
i18n (~> 0.5.0)
|
15
|
+
activerecord (3.0.20)
|
16
|
+
activemodel (= 3.0.20)
|
17
|
+
activesupport (= 3.0.20)
|
18
|
+
arel (~> 2.0.10)
|
19
|
+
tzinfo (~> 0.3.23)
|
20
|
+
activesupport (3.0.20)
|
21
|
+
arel (2.0.10)
|
22
|
+
builder (2.1.2)
|
23
|
+
database_cleaner (0.6.7)
|
48
24
|
ffi2-generators (0.1.1)
|
49
|
-
|
50
|
-
|
25
|
+
friendly_id (4.0.10.1)
|
26
|
+
activerecord (>= 3.0, < 4.0)
|
27
|
+
i18n (0.5.3)
|
51
28
|
json (1.8.1)
|
52
|
-
|
29
|
+
metaclass (0.0.1)
|
53
30
|
minitest (4.7.5)
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
multi_json (1.8.2)
|
60
|
-
powerbar (1.0.11)
|
61
|
-
ansi (~> 1.4.0)
|
62
|
-
hashie (>= 1.1.0)
|
63
|
-
pry (0.9.12.4)
|
64
|
-
coderay (~> 1.0)
|
65
|
-
method_source (~> 0.8)
|
66
|
-
slop (~> 3.4)
|
67
|
-
pry-nav (0.2.3)
|
68
|
-
pry (~> 0.9.10)
|
69
|
-
rake (10.1.0)
|
70
|
-
rdoc (3.12.2)
|
31
|
+
mocha (0.14.0)
|
32
|
+
metaclass (~> 0.0.1)
|
33
|
+
pathname_local (0.0.2)
|
34
|
+
rake (10.1.1)
|
35
|
+
rdoc (4.1.0)
|
71
36
|
json (~> 1.4)
|
72
37
|
rubysl (2.0.15)
|
73
38
|
rubysl-abbrev (~> 2.0)
|
@@ -173,7 +138,7 @@ GEM
|
|
173
138
|
rubysl-coverage (2.0.3)
|
174
139
|
rubysl-csv (2.0.2)
|
175
140
|
rubysl-english (~> 2.0)
|
176
|
-
rubysl-curses (2.0.
|
141
|
+
rubysl-curses (2.0.1)
|
177
142
|
rubysl-date (2.0.6)
|
178
143
|
rubysl-delegate (2.0.1)
|
179
144
|
rubysl-digest (2.0.3)
|
@@ -271,24 +236,24 @@ GEM
|
|
271
236
|
rubysl-xmlrpc (2.0.0)
|
272
237
|
rubysl-yaml (2.0.4)
|
273
238
|
rubysl-zlib (2.0.1)
|
274
|
-
slop (3.4.7)
|
275
239
|
sqlite3 (1.3.8)
|
276
|
-
|
277
|
-
|
240
|
+
test-unit (2.0.0.0)
|
241
|
+
test_declarative (0.0.5)
|
278
242
|
tzinfo (0.3.38)
|
279
243
|
|
280
244
|
PLATFORMS
|
281
245
|
ruby
|
282
246
|
|
283
247
|
DEPENDENCIES
|
284
|
-
database_cleaner
|
248
|
+
database_cleaner (~> 0.6.0)
|
249
|
+
friendly_id
|
285
250
|
globalize!
|
286
251
|
minitest
|
287
|
-
|
288
|
-
|
289
|
-
pry
|
290
|
-
pry-nav
|
252
|
+
mocha
|
253
|
+
pathname_local
|
291
254
|
rake
|
292
255
|
rdoc
|
293
256
|
rubysl (~> 2.0)
|
294
257
|
sqlite3
|
258
|
+
test-unit
|
259
|
+
test_declarative
|
data/lib/globalize.rb
CHANGED
@@ -77,17 +77,6 @@ module Globalize
|
|
77
77
|
after_create :save_translations!
|
78
78
|
after_update :save_translations!
|
79
79
|
|
80
|
-
if options[:versioning]
|
81
|
-
if options[:versioning].is_a?(Hash)
|
82
|
-
translation_class.versioned options[:versioning]
|
83
|
-
else
|
84
|
-
::ActiveRecord::Base.extend(Globalize::Versioning::PaperTrail)
|
85
|
-
|
86
|
-
translation_class.has_paper_trail
|
87
|
-
delegate :version, :versions, :to => :translation
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
80
|
translation_class.instance_eval %{ attr_accessible :locale }
|
92
81
|
end
|
93
82
|
end
|
data/lib/globalize/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: globalize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Fuchs
|
@@ -14,50 +14,48 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2014-01-09 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: activerecord
|
21
21
|
requirement: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
|
-
- - '>='
|
23
|
+
- - ! '>='
|
24
24
|
- !ruby/object:Gem::Version
|
25
25
|
version: 3.0.0
|
26
|
+
- - <
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 4.0.0
|
26
29
|
type: :runtime
|
27
30
|
prerelease: false
|
28
31
|
version_requirements: !ruby/object:Gem::Requirement
|
29
32
|
requirements:
|
30
|
-
- - '>='
|
33
|
+
- - ! '>='
|
31
34
|
- !ruby/object:Gem::Version
|
32
35
|
version: 3.0.0
|
36
|
+
- - <
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 4.0.0
|
33
39
|
- !ruby/object:Gem::Dependency
|
34
40
|
name: activemodel
|
35
41
|
requirement: !ruby/object:Gem::Requirement
|
36
42
|
requirements:
|
37
|
-
- - '>='
|
43
|
+
- - ! '>='
|
38
44
|
- !ruby/object:Gem::Version
|
39
45
|
version: 3.0.0
|
46
|
+
- - <
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 4.0.0
|
40
49
|
type: :runtime
|
41
50
|
prerelease: false
|
42
51
|
version_requirements: !ruby/object:Gem::Requirement
|
43
52
|
requirements:
|
44
|
-
- - '>='
|
53
|
+
- - ! '>='
|
45
54
|
- !ruby/object:Gem::Version
|
46
55
|
version: 3.0.0
|
47
|
-
-
|
48
|
-
name: paper_trail
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - ~>
|
56
|
+
- - <
|
52
57
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - ~>
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '2'
|
58
|
+
version: 4.0.0
|
61
59
|
- !ruby/object:Gem::Dependency
|
62
60
|
name: database_cleaner
|
63
61
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,70 +74,98 @@ dependencies:
|
|
76
74
|
name: mocha
|
77
75
|
requirement: !ruby/object:Gem::Requirement
|
78
76
|
requirements:
|
79
|
-
- - '>='
|
77
|
+
- - ! '>='
|
80
78
|
- !ruby/object:Gem::Version
|
81
79
|
version: '0'
|
82
80
|
type: :development
|
83
81
|
prerelease: false
|
84
82
|
version_requirements: !ruby/object:Gem::Requirement
|
85
83
|
requirements:
|
86
|
-
- - '>='
|
84
|
+
- - ! '>='
|
87
85
|
- !ruby/object:Gem::Version
|
88
86
|
version: '0'
|
89
87
|
- !ruby/object:Gem::Dependency
|
90
88
|
name: pathname_local
|
91
89
|
requirement: !ruby/object:Gem::Requirement
|
92
90
|
requirements:
|
93
|
-
- - '>='
|
91
|
+
- - ! '>='
|
94
92
|
- !ruby/object:Gem::Version
|
95
93
|
version: '0'
|
96
94
|
type: :development
|
97
95
|
prerelease: false
|
98
96
|
version_requirements: !ruby/object:Gem::Requirement
|
99
97
|
requirements:
|
100
|
-
- - '>='
|
98
|
+
- - ! '>='
|
101
99
|
- !ruby/object:Gem::Version
|
102
100
|
version: '0'
|
103
101
|
- !ruby/object:Gem::Dependency
|
104
102
|
name: test_declarative
|
105
103
|
requirement: !ruby/object:Gem::Requirement
|
106
104
|
requirements:
|
107
|
-
- - '>='
|
105
|
+
- - ! '>='
|
108
106
|
- !ruby/object:Gem::Version
|
109
107
|
version: '0'
|
110
108
|
type: :development
|
111
109
|
prerelease: false
|
112
110
|
version_requirements: !ruby/object:Gem::Requirement
|
113
111
|
requirements:
|
114
|
-
- - '>='
|
112
|
+
- - ! '>='
|
115
113
|
- !ruby/object:Gem::Version
|
116
114
|
version: '0'
|
117
115
|
- !ruby/object:Gem::Dependency
|
118
116
|
name: friendly_id
|
119
117
|
requirement: !ruby/object:Gem::Requirement
|
120
118
|
requirements:
|
121
|
-
- - '>='
|
119
|
+
- - ! '>='
|
122
120
|
- !ruby/object:Gem::Version
|
123
121
|
version: '0'
|
124
122
|
type: :development
|
125
123
|
prerelease: false
|
126
124
|
version_requirements: !ruby/object:Gem::Requirement
|
127
125
|
requirements:
|
128
|
-
- - '>='
|
126
|
+
- - ! '>='
|
129
127
|
- !ruby/object:Gem::Version
|
130
128
|
version: '0'
|
131
129
|
- !ruby/object:Gem::Dependency
|
132
130
|
name: sqlite3
|
133
131
|
requirement: !ruby/object:Gem::Requirement
|
134
132
|
requirements:
|
135
|
-
- - '>='
|
133
|
+
- - ! '>='
|
136
134
|
- !ruby/object:Gem::Version
|
137
135
|
version: '0'
|
138
136
|
type: :development
|
139
137
|
prerelease: false
|
140
138
|
version_requirements: !ruby/object:Gem::Requirement
|
141
139
|
requirements:
|
142
|
-
- - '>='
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: rake
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ! '>='
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
- !ruby/object:Gem::Dependency
|
158
|
+
name: rdoc
|
159
|
+
requirement: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ! '>='
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
type: :development
|
165
|
+
prerelease: false
|
166
|
+
version_requirements: !ruby/object:Gem::Requirement
|
167
|
+
requirements:
|
168
|
+
- - ! '>='
|
143
169
|
- !ruby/object:Gem::Version
|
144
170
|
version: '0'
|
145
171
|
description: Rails I18n de-facto standard library for ActiveRecord model/data translation.
|
@@ -148,52 +174,74 @@ executables: []
|
|
148
174
|
extensions: []
|
149
175
|
extra_rdoc_files: []
|
150
176
|
files:
|
151
|
-
- lib/globalize.rb
|
152
|
-
- lib/
|
153
|
-
- lib/patches/active_record/uniqueness_validator.rb
|
154
|
-
- lib/patches/active_record/query_method.rb
|
155
|
-
- lib/patches/i18n/interpolate.rb
|
177
|
+
- lib/globalize/interpolation.rb
|
178
|
+
- lib/globalize/version.rb
|
156
179
|
- lib/globalize/active_record.rb
|
157
|
-
- lib/globalize/
|
180
|
+
- lib/globalize/active_record/attributes.rb
|
181
|
+
- lib/globalize/active_record/instance_methods.rb
|
158
182
|
- lib/globalize/active_record/adapter.rb
|
159
|
-
- lib/globalize/active_record/query_methods.rb
|
160
|
-
- lib/globalize/active_record/migration.rb
|
161
|
-
- lib/globalize/active_record/act_macro.rb
|
162
183
|
- lib/globalize/active_record/translation.rb
|
163
|
-
- lib/globalize/active_record/
|
164
|
-
- lib/globalize/active_record/class_methods.rb
|
184
|
+
- lib/globalize/active_record/act_macro.rb
|
165
185
|
- lib/globalize/active_record/exceptions.rb
|
166
|
-
- lib/globalize/active_record/
|
167
|
-
- lib/globalize/
|
168
|
-
- lib/globalize/
|
169
|
-
- lib/globalize
|
186
|
+
- lib/globalize/active_record/query_methods.rb
|
187
|
+
- lib/globalize/active_record/class_methods.rb
|
188
|
+
- lib/globalize/active_record/migration.rb
|
189
|
+
- lib/globalize.rb
|
170
190
|
- lib/i18n/missing_translations_raise_handler.rb
|
171
191
|
- lib/i18n/missing_translations_log_handler.rb
|
172
|
-
-
|
192
|
+
- lib/patches/active_record/uniqueness_validator.rb
|
193
|
+
- lib/patches/active_record/query_method.rb
|
194
|
+
- lib/patches/active_record/xml_attribute_serializer.rb
|
195
|
+
- lib/patches/i18n/interpolate.rb
|
196
|
+
- CONTRIBUTING.md
|
197
|
+
- Gemfile.lock
|
198
|
+
- CHANGELOG.md
|
173
199
|
- LICENSE
|
200
|
+
- Rakefile
|
174
201
|
- Gemfile
|
175
|
-
- Gemfile.lock
|
176
202
|
homepage: https://github.com/globalize/globalize
|
177
203
|
licenses:
|
178
204
|
- MIT
|
179
205
|
metadata: {}
|
180
|
-
post_install_message:
|
206
|
+
post_install_message: ! '
|
207
|
+
|
208
|
+
Globalize has extracted versioning support to a separate gem named
|
209
|
+
|
210
|
+
globalize-versioning. If you are using versioning (with paper_trail
|
211
|
+
|
212
|
+
or any other versioning gem), please add the line
|
213
|
+
|
214
|
+
"gem ''globalize-versioning''" to your Gemfile and go to the github
|
215
|
+
|
216
|
+
page at globalize/globalize-versioning if you encounter any problems.
|
217
|
+
|
218
|
+
|
219
|
+
Note that the globalize-versioning gem does not delegate versions to
|
220
|
+
|
221
|
+
the translation table, so you will have to update your syntax to
|
222
|
+
|
223
|
+
the form: `post.translation.versions`. See the globalize-versioning
|
224
|
+
|
225
|
+
readme for details.
|
226
|
+
|
227
|
+
|
228
|
+
'
|
181
229
|
rdoc_options: []
|
182
230
|
require_paths:
|
183
231
|
- lib
|
184
232
|
required_ruby_version: !ruby/object:Gem::Requirement
|
185
233
|
requirements:
|
186
|
-
- - '>='
|
234
|
+
- - ! '>='
|
187
235
|
- !ruby/object:Gem::Version
|
188
236
|
version: '0'
|
189
237
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
238
|
requirements:
|
191
|
-
- - '>='
|
239
|
+
- - ! '>='
|
192
240
|
- !ruby/object:Gem::Version
|
193
241
|
version: '0'
|
194
242
|
requirements: []
|
195
243
|
rubyforge_project:
|
196
|
-
rubygems_version: 2.0.
|
244
|
+
rubygems_version: 2.0.5
|
197
245
|
signing_key:
|
198
246
|
specification_version: 4
|
199
247
|
summary: Rails I18n de-facto standard library for ActiveRecord model/data translation
|
data/lib/globalize/versioning.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'paper_trail'
|
2
|
-
|
3
|
-
module Globalize
|
4
|
-
module Versioning
|
5
|
-
module PaperTrail
|
6
|
-
# At present this isn't used but we may use something similar in paper trail
|
7
|
-
# shortly, so leaving it around to reference easily.
|
8
|
-
#def versioned_columns
|
9
|
-
#super + self.class.translated_attribute_names
|
10
|
-
#end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
ActiveRecord::Base.class_eval do
|
16
|
-
class << self
|
17
|
-
def has_paper_trail_with_globalize(*args)
|
18
|
-
has_paper_trail_without_globalize(*args)
|
19
|
-
include Globalize::Versioning::PaperTrail
|
20
|
-
end
|
21
|
-
alias_method_chain :has_paper_trail, :globalize
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
Version.class_eval do
|
26
|
-
|
27
|
-
before_save do |version|
|
28
|
-
version.locale = Globalize.locale.to_s
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.locale_conditions_to_sql
|
32
|
-
"locale = '#{Globalize.locale.to_s}'"
|
33
|
-
end
|
34
|
-
|
35
|
-
scope :for_this_locale, lambda{ { :conditions => locale_conditions_to_sql } }
|
36
|
-
|
37
|
-
def sibling_versions_with_locales
|
38
|
-
sibling_versions_without_locales.for_this_locale
|
39
|
-
end
|
40
|
-
alias_method_chain :sibling_versions, :locales
|
41
|
-
end
|