globalize 5.1.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -0
- data/Appraisals +53 -0
- data/CHANGELOG.md +24 -1
- data/CONTRIBUTING.md +16 -1
- data/Gemfile +11 -17
- data/README.md +11 -8
- data/docker-compose.yml +22 -0
- data/globalize.gemspec +37 -0
- data/issue_template.rb +38 -0
- data/lib/globalize.rb +16 -0
- data/lib/globalize/active_record.rb +10 -10
- data/lib/globalize/active_record/act_macro.rb +5 -4
- data/lib/globalize/active_record/adapter.rb +9 -0
- data/lib/globalize/active_record/adapter_dirty.rb +37 -3
- data/lib/globalize/active_record/class_methods.rb +4 -3
- data/lib/globalize/active_record/instance_methods.rb +55 -16
- data/lib/globalize/active_record/migration.rb +7 -4
- data/lib/globalize/active_record/{query_methods.rb → translated_attributes_query.rb} +59 -1
- data/lib/globalize/version.rb +3 -1
- metadata +86 -16
- metadata.gz.sig +0 -0
- data/Gemfile.lock +0 -314
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7501e626a9b5bfd187c9db3d0b5a809351308d7783c606a486cb9dab2a7d1649
|
4
|
+
data.tar.gz: f3661b320279e118f396356680dceaa12d322495d823978a1b89d9628ec712de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 525c265c86c7ed85a78dea1c721c20f98db1b74cf23bb49453e5677c3ee4605e18fe708d1e1f77723b784f5d98f717181f154c7cd664fe54236756711149881a
|
7
|
+
data.tar.gz: 25e5300ccf2279af73d7e8df8c2ffd5f23a616a3d1fbb3c6289dff82182277b4e045a7ca1443643b44f78f9d0ac2cb5a188ebe9a7e455dd2cbb700d0dc857939
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
?$��ʀ�th1�7J����a/[��4a��jZ�X==�k����At��P�luU@'�~�=����+����ef>m�O�~)�����-)�z�,��q�nM��6iŨ��7_�G�5"2ɳx�A��
|
data/Appraisals
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RAILS_VERSIONS = %w[
|
4
|
+
4.2.11.3
|
5
|
+
5.1.7
|
6
|
+
5.2.4.4
|
7
|
+
6.0.3.4
|
8
|
+
6.1.0
|
9
|
+
]
|
10
|
+
|
11
|
+
RAILS_VERSIONS.each do |version|
|
12
|
+
appraise "rails_#{version}" do
|
13
|
+
gem 'activemodel', version
|
14
|
+
gem 'activerecord', version
|
15
|
+
|
16
|
+
if version =~ /^6/
|
17
|
+
gem 'sqlite3', '~> 1.4', platforms: [:ruby, :rbx]
|
18
|
+
elsif version =~ /^5/
|
19
|
+
gem 'sqlite3', '~> 1.3', '>= 1.3.6', platforms: [:ruby, :rbx]
|
20
|
+
else version =~ /^4/
|
21
|
+
gem 'sqlite3', '~> 1.3.6', platforms: [:ruby, :rbx]
|
22
|
+
end
|
23
|
+
|
24
|
+
if !ENV['CI'] || %w(postgres postgresql).include?(ENV['DB'])
|
25
|
+
group :postgres, :postgresql do
|
26
|
+
if version =~ /^4/
|
27
|
+
gem 'pg', '< 1.0', platforms: [:ruby, :rbx]
|
28
|
+
else
|
29
|
+
gem 'pg', '~> 1.1', platforms: [:ruby, :rbx]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
platforms :rbx do
|
35
|
+
gem "rubysl", "~> 2.0"
|
36
|
+
gem "rubinius-developer_tools"
|
37
|
+
end
|
38
|
+
|
39
|
+
platforms :jruby do
|
40
|
+
if !ENV['CI'] || ENV['DB'] == 'sqlite3'
|
41
|
+
gem 'activerecord-jdbcsqlite3-adapter', '~> 1'
|
42
|
+
end
|
43
|
+
|
44
|
+
if !ENV['CI'] || ENV['DB'] == 'mysql'
|
45
|
+
gem 'activerecord-jdbcmysql-adapter', '~> 1'
|
46
|
+
end
|
47
|
+
|
48
|
+
if !ENV['CI'] || %w(postgres postgresql).include?(ENV['DB'])
|
49
|
+
gem 'activerecord-jdbcpostgresql-adapter', '~> 1'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,29 @@
|
|
1
1
|
# Globalize Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## Unreleased
|
4
|
+
|
5
|
+
* Add `create_source_columns` option for migrations. [#715](https://github.com/globalize/globalize/pull/715) by [IlyasValiullov](https://github.com/IlyasValiullov)
|
6
|
+
* Autosave is now configurable, but defaults to false. [#736](https://github.com/globalize/globalize/pull/736) by [James Hart](https://github.com/hjhart)
|
7
|
+
* Fix foreign keys translation. [#769](https://github.com/globalize/globalize/pull/769) by [Sergey Tokarenko](https://github.com/stokarenko)
|
8
|
+
|
9
|
+
## 5.3.0 (2019-05-14)
|
10
|
+
|
11
|
+
* Prevent 'SystemStackError: stack level too deep' error on attribute reset. [#722](https://github.com/globalize/globalize/pull/722) by [Reinier de Lange](https://github.com/moiristo)
|
12
|
+
* Pass the `:limit` option for the FK column. [#721](https://github.com/globalize/globalize/pull/721) by [Denis Demchenko](https://github.com/lancedikson)
|
13
|
+
* Add support for Rails 6.0. [#718](https://github.com/globalize/globalize/pull/718) by [Chrıs Seelus](https://github.com/cseelus)
|
14
|
+
* FIX: stop registering the attr for Rails 4.2. [#711](https://github.com/globalize/globalize/pull/711) by [Adam Fernung](https://github.com/akfernun)
|
15
|
+
|
16
|
+
## 5.2.0 (2018-11-02)
|
17
|
+
|
18
|
+
* Add support for translated attributes to other QueryMethods and Calculations [#707](https://github.com/globalize/globalize/pull/707) by [kreintjes](https://github.com/kreintjes)
|
19
|
+
* Fix `read_attribute` for Rails changes. [#709](https://github.com/globalize/globalize/pull/709) by [ota42y](https://github.com/ota42y) and [nabuchi](https://github.com/nabuchi)
|
20
|
+
* Support array as an argument of order. [#675](https://github.com/globalize/globalize/pull/675) by [Maicol Bentancor](https://github.com/MaicolBen)
|
21
|
+
* `_reset_attribute` bugfix. [#674](https://github.com/globalize/globalize/pull/674) by [ota42y](https://github.com/ota42y)
|
22
|
+
* Add support for Rails 5.2 [#678](https://github.com/globalize/globalize/pull/678) by [kevin-jj](https://github.com/kevin-jj)
|
23
|
+
* Fix: wrong number of arguments for ActiveRecord 'attribute' method [#671](https://github.com/globalize/globalize/pull/671) by [Evgeny Danilov](https://github.com/jmelkor)
|
24
|
+
* Resolve deprecation warning: attribute is not an attribute known to Active Record. [#629](https://github.com/globalize/globalize/pull/629) by [Michael Rüffer](https://github.com/itschn)
|
25
|
+
|
26
|
+
## 5.1.0 (2018-01-15)
|
4
27
|
|
5
28
|
* Replaced `after_` callbacks with `before_` callbacks and set `autosave: true` by default. [#341](https://github.com/globalize/globalize/pull/341) by [Andrew Volozhanin](https://github.com/scarfacedeb)
|
6
29
|
* Add [RequestStore](https://github.com/steveklabnik/request_store) to make Globalize thread-safe again [#420](https://github.com/globalize/globalize/pull/420)
|
data/CONTRIBUTING.md
CHANGED
@@ -34,4 +34,19 @@ Have a bug fix, code improvement or proposed feature? Do the following:
|
|
34
34
|
|
35
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
36
|
|
37
|
-
When you submit the pull request,
|
37
|
+
When you submit the pull request, GitHub Actions will run the [test suite](https://github.com/globalize/globalize/actions) 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.
|
38
|
+
|
39
|
+
## Testing
|
40
|
+
|
41
|
+
### Requirements
|
42
|
+
|
43
|
+
- Ruby
|
44
|
+
- Bundler
|
45
|
+
- SQLite
|
46
|
+
- You can switch the database by adding an environment variable. See `test/support/database.rb`.
|
47
|
+
- You can also configure your database configurations. See `test/support/database.yml`.
|
48
|
+
|
49
|
+
### Run tests on your local machine
|
50
|
+
|
51
|
+
- `bundle install`
|
52
|
+
- `bundle exec rake`
|
data/Gemfile
CHANGED
@@ -1,26 +1,20 @@
|
|
1
|
-
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
platforms :rbx do
|
10
|
-
gem "rubysl", "~> 2.0"
|
11
|
-
gem "rubinius-developer_tools"
|
5
|
+
# Database Configuration
|
6
|
+
if !ENV['CI'] || ENV['DB'] == 'sqlite3'
|
7
|
+
gem 'sqlite3', platforms: [:ruby, :rbx]
|
12
8
|
end
|
13
9
|
|
14
|
-
|
15
|
-
|
16
|
-
gem '
|
17
|
-
end
|
18
|
-
|
19
|
-
if !ENV['TRAVIS'] || ENV['DB'] == 'mysql'
|
20
|
-
gem 'activerecord-jdbcmysql-adapter', git: "https://github.com/jruby/activerecord-jdbc-adapter"
|
10
|
+
if !ENV['CI'] || ENV['DB'] == 'mysql'
|
11
|
+
group :mysql do
|
12
|
+
gem 'mysql2', platforms: [:ruby, :rbx]
|
21
13
|
end
|
14
|
+
end
|
22
15
|
|
23
|
-
|
24
|
-
|
16
|
+
if !ENV['CI'] || %w(postgres postgresql).include?(ENV['DB'])
|
17
|
+
group :postgres, :postgresql do
|
18
|
+
gem 'pg', '< 1.0', platforms: [:ruby, :rbx]
|
25
19
|
end
|
26
20
|
end
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
![Globalize](http://globalize.github.io/globalize/images/globalize.png)
|
2
2
|
|
3
|
-
[![Build Status](https://
|
3
|
+
[![Build Status](https://github.com/globalize/globalize/workflows/CI/badge.svg)](https://github.com/globalize/globalize/actions) [![Code Climate](https://codeclimate.com/github/globalize/globalize.svg)](https://codeclimate.com/github/globalize/globalize)
|
4
|
+
[![Open Source Helpers](https://www.codetriage.com/globalize/globalize/badges/users.svg)](https://www.codetriage.com/globalize/globalize)
|
4
5
|
|
5
6
|
You can chat with us using Gitter:
|
6
7
|
|
@@ -11,6 +12,11 @@ to add model translations to ActiveRecord models.
|
|
11
12
|
|
12
13
|
In other words, a way to translate actual user-generated content, for example; a single blog post with multiple translations.
|
13
14
|
|
15
|
+
## Current state of the gem
|
16
|
+
|
17
|
+
Globalize is not very actively maintained. Pull Requests are welcome, especially for compatibility with new versions of Rails, but none of the maintainers actively use Globalize anymore. If you need a more actively maintained model translation gem, we recommend checking out [Mobility](https://github.com/shioyama/mobility), a natural successor of Globalize created by Chris Salzberg (one of Globalize maintainers) and inspired by the ideas discussed around Globalize. For a more up-to-date discussion of the current situation, see [issue #753](https://github.com/globalize/globalize/issues/753).
|
18
|
+
|
19
|
+
|
14
20
|
## Requirements
|
15
21
|
|
16
22
|
* ActiveRecord >= 4.2.0 (see below for installation with ActiveRecord 3.x)
|
@@ -27,13 +33,7 @@ gem install globalize
|
|
27
33
|
When using bundler put this in your Gemfile:
|
28
34
|
|
29
35
|
```ruby
|
30
|
-
gem 'globalize', '~> 5.
|
31
|
-
```
|
32
|
-
|
33
|
-
You have to use the **master** branch to work with Rails 5, or you can use a pre-release gem:
|
34
|
-
|
35
|
-
```ruby
|
36
|
-
gem 'globalize', '~> 5.1.0.beta2'
|
36
|
+
gem 'globalize', '~> 5.3.0'
|
37
37
|
```
|
38
38
|
|
39
39
|
Please help us by letting us know what works, and what doesn't, when using pre-release code.
|
@@ -276,6 +276,9 @@ You can enable them by adding the next line to `config/application.rb` (or only
|
|
276
276
|
`config/environments/production.rb` if you only want them in production)
|
277
277
|
|
278
278
|
```ruby
|
279
|
+
# For version 1.1.0 and above of the `i18n` gem:
|
280
|
+
config.i18n.fallbacks = [I18n.default_locale]
|
281
|
+
# Below version 1.1.0 of the `i18n` gem:
|
279
282
|
config.i18n.fallbacks = true
|
280
283
|
```
|
281
284
|
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
version: '3.7'
|
2
|
+
services:
|
3
|
+
postgres:
|
4
|
+
image: postgres:11
|
5
|
+
volumes:
|
6
|
+
- ./tmp/postgres:/var/lib/postgresql/data
|
7
|
+
ports:
|
8
|
+
- "5432:5432"
|
9
|
+
environment:
|
10
|
+
POSTGRES_USER: "postgres"
|
11
|
+
POSTGRES_PASSWORD: ""
|
12
|
+
mysql:
|
13
|
+
image: mysql:8.0
|
14
|
+
volumes:
|
15
|
+
- ./tmp/mysql:/var/lib/mysql
|
16
|
+
ports:
|
17
|
+
- "3306:3306"
|
18
|
+
environment:
|
19
|
+
MYSQL_USER: "root"
|
20
|
+
MYSQL_PASSWORD: ""
|
21
|
+
MYSQL_ROOT_PASSWORD: ""
|
22
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
|
data/globalize.gemspec
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/globalize/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'globalize'
|
7
|
+
s.version = Globalize::Version
|
8
|
+
s.authors = ['Sven Fuchs', 'Joshua Harvey', 'Clemens Kofler', 'John-Paul Bader', 'Tomasz Stachewicz', 'Philip Arndt', 'Chris Salzberg']
|
9
|
+
s.email = 'nobody@globalize-rails.org'
|
10
|
+
s.homepage = 'http://github.com/globalize/globalize'
|
11
|
+
s.summary = 'Rails I18n de-facto standard library for ActiveRecord model/data translation'
|
12
|
+
s.description = "#{s.summary}."
|
13
|
+
s.license = "MIT"
|
14
|
+
|
15
|
+
s.files = Dir['{lib/**/*,[A-Z]*}']
|
16
|
+
s.platform = Gem::Platform::RUBY
|
17
|
+
s.require_path = 'lib'
|
18
|
+
s.required_ruby_version = '>= 2.4.6'
|
19
|
+
|
20
|
+
s.add_dependency 'activerecord', '>= 4.2', '< 7.0'
|
21
|
+
s.add_dependency 'activemodel', '>= 4.2', '< 7.0'
|
22
|
+
s.add_dependency 'request_store', '~> 1.0'
|
23
|
+
|
24
|
+
s.add_development_dependency 'appraisal'
|
25
|
+
s.add_development_dependency 'database_cleaner'
|
26
|
+
s.add_development_dependency 'm'
|
27
|
+
s.add_development_dependency 'minitest'
|
28
|
+
s.add_development_dependency 'minitest-reporters'
|
29
|
+
s.add_development_dependency 'pry'
|
30
|
+
s.add_development_dependency 'rake'
|
31
|
+
s.add_development_dependency 'rdoc'
|
32
|
+
|
33
|
+
s.cert_chain = [File.expand_path('certs/parndt.pem', __dir__)]
|
34
|
+
if $PROGRAM_NAME =~ /gem\z/ && ARGV.include?('build') && ARGV.include?(__FILE__)
|
35
|
+
s.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
|
36
|
+
end
|
37
|
+
end
|
data/issue_template.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# Activate the gem you are reporting the issue against.
|
2
|
+
gem 'activerecord', '4.2.0'
|
3
|
+
gem 'globalize', '5.0.1'
|
4
|
+
require 'active_record'
|
5
|
+
require 'globalize'
|
6
|
+
require 'minitest/autorun'
|
7
|
+
require 'logger'
|
8
|
+
|
9
|
+
# Ensure backward compatibility with Minitest 4
|
10
|
+
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
|
11
|
+
|
12
|
+
# This connection will do for database-independent bug reports.
|
13
|
+
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
|
14
|
+
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
15
|
+
|
16
|
+
ActiveRecord::Schema.define do
|
17
|
+
create_table :posts, force: true do |t|
|
18
|
+
end
|
19
|
+
|
20
|
+
create_table :post_translations, force: true do |t|
|
21
|
+
t.references :post
|
22
|
+
t.string :title
|
23
|
+
t.text :content
|
24
|
+
t.string :locale
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
class Post < ActiveRecord::Base
|
29
|
+
translates :content, :title
|
30
|
+
end
|
31
|
+
|
32
|
+
class BugTest < Minitest::Test
|
33
|
+
def test_association_stuff
|
34
|
+
post = Post.create!(title: 'HI')
|
35
|
+
|
36
|
+
assert_equal 'HI', post.title
|
37
|
+
end
|
38
|
+
end
|
data/lib/globalize.rb
CHANGED
@@ -58,6 +58,22 @@ module Globalize
|
|
58
58
|
RequestStore.store
|
59
59
|
end
|
60
60
|
|
61
|
+
def rails_5?
|
62
|
+
::ActiveRecord.version >= Gem::Version.new('5.1.0')
|
63
|
+
end
|
64
|
+
|
65
|
+
def rails_52?
|
66
|
+
::ActiveRecord.version >= Gem::Version.new('5.2.0')
|
67
|
+
end
|
68
|
+
|
69
|
+
def rails_6?
|
70
|
+
::ActiveRecord.version >= Gem::Version.new('6.0.0')
|
71
|
+
end
|
72
|
+
|
73
|
+
def rails_61?
|
74
|
+
::ActiveRecord.version >= Gem::Version.new('6.1.0')
|
75
|
+
end
|
76
|
+
|
61
77
|
protected
|
62
78
|
|
63
79
|
def read_locale
|
@@ -1,14 +1,14 @@
|
|
1
1
|
module Globalize
|
2
2
|
module ActiveRecord
|
3
|
-
autoload :ActMacro,
|
4
|
-
autoload :Adapter,
|
5
|
-
autoload :AdapterDirty,
|
6
|
-
autoload :Attributes,
|
7
|
-
autoload :ClassMethods,
|
8
|
-
autoload :Exceptions,
|
9
|
-
autoload :InstanceMethods,
|
10
|
-
autoload :Migration,
|
11
|
-
autoload :Translation,
|
12
|
-
autoload :
|
3
|
+
autoload :ActMacro, 'globalize/active_record/act_macro'
|
4
|
+
autoload :Adapter, 'globalize/active_record/adapter'
|
5
|
+
autoload :AdapterDirty, 'globalize/active_record/adapter_dirty'
|
6
|
+
autoload :Attributes, 'globalize/active_record/attributes'
|
7
|
+
autoload :ClassMethods, 'globalize/active_record/class_methods'
|
8
|
+
autoload :Exceptions, 'globalize/active_record/exceptions'
|
9
|
+
autoload :InstanceMethods, 'globalize/active_record/instance_methods'
|
10
|
+
autoload :Migration, 'globalize/active_record/migration'
|
11
|
+
autoload :Translation, 'globalize/active_record/translation'
|
12
|
+
autoload :TranslatedAttributesQuery, 'globalize/active_record/translated_attributes_query'
|
13
13
|
end
|
14
14
|
end
|
@@ -41,7 +41,7 @@ module Globalize
|
|
41
41
|
end
|
42
42
|
|
43
43
|
begin
|
44
|
-
if ::ActiveRecord::VERSION::STRING > "5.0" && table_exists? &&translation_class.table_exists?
|
44
|
+
if ::ActiveRecord::VERSION::STRING > "5.0" && table_exists? && translation_class.table_exists?
|
45
45
|
self.ignored_columns += translated_attribute_names.map(&:to_s)
|
46
46
|
reset_column_information
|
47
47
|
end
|
@@ -68,6 +68,7 @@ module Globalize
|
|
68
68
|
def apply_globalize_options(options)
|
69
69
|
options[:table_name] ||= "#{table_name.singularize}_translations"
|
70
70
|
options[:foreign_key] ||= class_name.foreign_key
|
71
|
+
options[:autosave] ||= false
|
71
72
|
|
72
73
|
class_attribute :translated_attribute_names, :translation_options, :fallbacks_for_empty_translations
|
73
74
|
self.translated_attribute_names = []
|
@@ -99,11 +100,11 @@ module Globalize
|
|
99
100
|
:foreign_key => options[:foreign_key],
|
100
101
|
:dependent => :destroy,
|
101
102
|
:extend => HasManyExtensions,
|
102
|
-
:autosave =>
|
103
|
+
:autosave => options[:autosave],
|
103
104
|
:inverse_of => :globalized_model
|
104
105
|
|
105
|
-
|
106
|
-
|
106
|
+
after_create :save_translations!
|
107
|
+
after_update :save_translations!
|
107
108
|
end
|
108
109
|
end
|
109
110
|
|
@@ -43,6 +43,9 @@ module Globalize
|
|
43
43
|
value = value.val if value.is_a?(Arel::Nodes::Casted)
|
44
44
|
translation[name] = value
|
45
45
|
end
|
46
|
+
|
47
|
+
ensure_foreign_key_for(translation)
|
48
|
+
translation.save!
|
46
49
|
end
|
47
50
|
|
48
51
|
reset
|
@@ -54,6 +57,12 @@ module Globalize
|
|
54
57
|
|
55
58
|
protected
|
56
59
|
|
60
|
+
# Sometimes the translation is initialised before a foreign key can be set.
|
61
|
+
def ensure_foreign_key_for(translation)
|
62
|
+
# AR >= 4.1 reflections renamed to _reflections
|
63
|
+
translation[translation.class.reflections.stringify_keys["globalized_model"].foreign_key] = record.id
|
64
|
+
end
|
65
|
+
|
57
66
|
def type_cast(name, value)
|
58
67
|
return value.presence unless column = column_for_attribute(name)
|
59
68
|
|
@@ -36,19 +36,53 @@ module Globalize
|
|
36
36
|
dirty[name][locale] = old
|
37
37
|
end
|
38
38
|
end
|
39
|
+
|
39
40
|
def clear_dirty
|
40
41
|
self.dirty = {}
|
41
42
|
end
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
if Globalize.rails_6?
|
45
|
+
def _reset_attribute name
|
46
|
+
record.send(:clear_attribute_changes, [name])
|
47
|
+
end
|
48
|
+
else
|
49
|
+
def _reset_attribute name
|
50
|
+
original_value = record.changed_attributes[name]
|
51
|
+
record.send(:clear_attribute_changes, [name])
|
52
|
+
record.send("#{name}=", original_value)
|
53
|
+
record.send(:clear_attribute_changes, [name])
|
54
|
+
end
|
46
55
|
end
|
47
56
|
|
48
57
|
def reset
|
49
58
|
clear_dirty
|
50
59
|
super
|
51
60
|
end
|
61
|
+
|
62
|
+
def changed_attributes(locale)
|
63
|
+
Hash[changes(locale).map { |name, change| [name, change.first] }]
|
64
|
+
end
|
65
|
+
|
66
|
+
def changed
|
67
|
+
stash.keys.flat_map { |locale| changes(locale).keys }.uniq
|
68
|
+
end
|
69
|
+
|
70
|
+
def changes(locale)
|
71
|
+
stash[locale].keys.inject({}) do |hash, name|
|
72
|
+
next hash unless dirty[name].is_a?(Hash)
|
73
|
+
next hash unless dirty[name].key?(locale)
|
74
|
+
|
75
|
+
new_value = stash[locale][name]
|
76
|
+
old_value = dirty[name][locale]
|
77
|
+
|
78
|
+
unless new_value == old_value
|
79
|
+
hash[name] = [old_value, new_value]
|
80
|
+
end
|
81
|
+
|
82
|
+
hash
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
52
86
|
end
|
53
87
|
end
|
54
88
|
end
|
@@ -76,10 +76,10 @@ module Globalize
|
|
76
76
|
private
|
77
77
|
|
78
78
|
# Override the default relation method in order to return a subclass
|
79
|
-
# of ActiveRecord::Relation with custom finder
|
80
|
-
# attributes.
|
79
|
+
# of ActiveRecord::Relation with custom finder and calculation methods
|
80
|
+
# for translated attributes.
|
81
81
|
def relation
|
82
|
-
super.extending!(
|
82
|
+
super.extending!(TranslatedAttributesQuery)
|
83
83
|
end
|
84
84
|
|
85
85
|
protected
|
@@ -120,6 +120,7 @@ module Globalize
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def define_translations_accessor(name)
|
123
|
+
attribute(name, ::ActiveRecord::Type::Value.new) if ::ActiveRecord::VERSION::STRING >= "5.0"
|
123
124
|
define_translations_reader(name)
|
124
125
|
define_translations_writer(name)
|
125
126
|
end
|
@@ -17,10 +17,24 @@ module Globalize
|
|
17
17
|
with_given_locale(attributes) { super(attributes.except("locale"), *options) }
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
if Globalize.rails_52?
|
21
|
+
|
22
|
+
# In Rails 5.2 we need to override *_assign_attributes* as it's called earlier
|
23
|
+
# in the stack (before *assign_attributes*)
|
24
|
+
# See https://github.com/rails/rails/blob/master/activerecord/lib/active_record/attribute_assignment.rb#L11
|
25
|
+
def _assign_attributes(new_attributes)
|
26
|
+
attributes = new_attributes.stringify_keys
|
27
|
+
with_given_locale(attributes) { super(attributes.except("locale")) }
|
28
|
+
end
|
29
|
+
|
30
|
+
else
|
31
|
+
|
32
|
+
def assign_attributes(new_attributes, *options)
|
33
|
+
super unless new_attributes.respond_to?(:stringify_keys) && new_attributes.present?
|
34
|
+
attributes = new_attributes.stringify_keys
|
35
|
+
with_given_locale(attributes) { super(attributes.except("locale"), *options) }
|
36
|
+
end
|
37
|
+
|
24
38
|
end
|
25
39
|
|
26
40
|
def write_attribute(name, value, *args, &block)
|
@@ -39,19 +53,21 @@ module Globalize
|
|
39
53
|
end
|
40
54
|
end
|
41
55
|
|
42
|
-
def read_attribute(
|
43
|
-
|
44
|
-
|
56
|
+
def read_attribute(attr_name, options = {}, &block)
|
57
|
+
name = if self.class.attribute_alias?(attr_name)
|
58
|
+
self.class.attribute_alias(attr_name).to_s
|
59
|
+
else
|
60
|
+
attr_name.to_s
|
61
|
+
end
|
45
62
|
|
46
|
-
if
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
63
|
+
name = self.class.primary_key if name == "id".freeze && self.class.primary_key
|
64
|
+
|
65
|
+
_read_attribute(name, options, &block)
|
66
|
+
end
|
67
|
+
|
68
|
+
def _read_attribute(attr_name, options = {}, &block)
|
69
|
+
translated_value = read_translated_attribute(attr_name, options)
|
70
|
+
translated_value.nil? ? super(attr_name, &block) : translated_value
|
55
71
|
end
|
56
72
|
|
57
73
|
def attribute_names
|
@@ -169,6 +185,20 @@ module Globalize
|
|
169
185
|
changed_attributes.present? || translations.any?(&:changed?)
|
170
186
|
end
|
171
187
|
|
188
|
+
if Globalize.rails_6?
|
189
|
+
def changed_attributes
|
190
|
+
super.merge(globalize.changed_attributes(::Globalize.locale))
|
191
|
+
end
|
192
|
+
|
193
|
+
def changes
|
194
|
+
super.merge(globalize.changes(::Globalize.locale))
|
195
|
+
end
|
196
|
+
|
197
|
+
def changed
|
198
|
+
super.concat(globalize.changed).uniq
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
172
202
|
# need to access instance variable directly since changed_attributes
|
173
203
|
# is frozen as of Rails 4.2
|
174
204
|
def original_changed_attributes
|
@@ -213,6 +243,15 @@ module Globalize
|
|
213
243
|
ensure
|
214
244
|
self.fallbacks_for_empty_translations = before
|
215
245
|
end
|
246
|
+
|
247
|
+
# nil or value
|
248
|
+
def read_translated_attribute(name, options)
|
249
|
+
options = {:translated => true, :locale => nil}.merge(options)
|
250
|
+
return nil unless options[:translated]
|
251
|
+
return nil unless translated?(name)
|
252
|
+
|
253
|
+
globalize.fetch(options[:locale] || Globalize.locale, name)
|
254
|
+
end
|
216
255
|
end
|
217
256
|
end
|
218
257
|
end
|
@@ -62,6 +62,7 @@ module Globalize
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def drop_translation_table!(options = {})
|
65
|
+
add_missing_columns if options[:create_source_columns]
|
65
66
|
move_data_to_model_table if options[:migrate_data]
|
66
67
|
drop_translations_index
|
67
68
|
drop_translation_table
|
@@ -78,7 +79,11 @@ module Globalize
|
|
78
79
|
|
79
80
|
def create_translation_table
|
80
81
|
connection.create_table(translations_table_name) do |t|
|
81
|
-
t.references table_name.sub(/^#{table_name_prefix}/, '').singularize,
|
82
|
+
t.references table_name.sub(/^#{table_name_prefix}/, '').singularize,
|
83
|
+
:null => false,
|
84
|
+
:index => false,
|
85
|
+
:type => column_type(model.primary_key).try(:to_sym),
|
86
|
+
:limit => model.columns.detect { |c| c.name == model.primary_key }.try(:limit)
|
82
87
|
t.string :locale, :null => false
|
83
88
|
t.timestamps :null => false
|
84
89
|
end
|
@@ -144,8 +149,6 @@ module Globalize
|
|
144
149
|
end
|
145
150
|
|
146
151
|
def move_data_to_model_table
|
147
|
-
add_missing_columns
|
148
|
-
|
149
152
|
# Find all of the translated attributes for all records in the model.
|
150
153
|
all_translated_attributes = model.all.collect{|m| m.attributes}
|
151
154
|
all_translated_attributes.each do |translated_record|
|
@@ -166,7 +169,7 @@ module Globalize
|
|
166
169
|
end
|
167
170
|
|
168
171
|
def column_type(name)
|
169
|
-
columns.detect { |c| c.name == name.to_s }.try(:type)
|
172
|
+
columns.detect { |c| c.name == name.to_s }.try(:type) || :string
|
170
173
|
end
|
171
174
|
|
172
175
|
def valid_field_name?(name)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Globalize
|
2
2
|
module ActiveRecord
|
3
|
-
module
|
3
|
+
module TranslatedAttributesQuery
|
4
4
|
class WhereChain < ::ActiveRecord::QueryMethods::WhereChain
|
5
5
|
def not(opts, *rest)
|
6
6
|
if parsed = @scope.clone.parse_translated_conditions(opts)
|
@@ -21,6 +21,14 @@ module Globalize
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
def having(opts, *rest)
|
25
|
+
if parsed = parse_translated_conditions(opts)
|
26
|
+
join_translations(super(parsed, *rest))
|
27
|
+
else
|
28
|
+
super
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
24
32
|
def order(opts, *rest)
|
25
33
|
if respond_to?(:translated_attribute_names) && parsed = parse_translated_order(opts)
|
26
34
|
join_translations super(parsed)
|
@@ -29,6 +37,30 @@ module Globalize
|
|
29
37
|
end
|
30
38
|
end
|
31
39
|
|
40
|
+
def reorder(opts, *rest)
|
41
|
+
if respond_to?(:translated_attribute_names) && parsed = parse_translated_order(opts)
|
42
|
+
join_translations super(parsed)
|
43
|
+
else
|
44
|
+
super
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def group(*columns)
|
49
|
+
if respond_to?(:translated_attribute_names) && parsed = parse_translated_columns(columns)
|
50
|
+
join_translations super(parsed)
|
51
|
+
else
|
52
|
+
super
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def select(*columns)
|
57
|
+
if respond_to?(:translated_attribute_names) && parsed = parse_translated_columns(columns)
|
58
|
+
join_translations super(parsed)
|
59
|
+
else
|
60
|
+
super
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
32
64
|
def exists?(conditions = :none)
|
33
65
|
if parsed = parse_translated_conditions(conditions)
|
34
66
|
with_translations_in_fallbacks.exists?(parsed)
|
@@ -37,6 +69,24 @@ module Globalize
|
|
37
69
|
end
|
38
70
|
end
|
39
71
|
|
72
|
+
def calculate(*args)
|
73
|
+
column_name = args[1]
|
74
|
+
if respond_to?(:translated_attribute_names) && translated_column?(column_name)
|
75
|
+
args[1] = translated_column_name(column_name)
|
76
|
+
join_translations.calculate(*args)
|
77
|
+
else
|
78
|
+
super
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def pluck(*column_names)
|
83
|
+
if respond_to?(:translated_attribute_names) && parsed = parse_translated_columns(column_names)
|
84
|
+
join_translations.pluck(*parsed)
|
85
|
+
else
|
86
|
+
super
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
40
90
|
def with_translations_in_fallbacks
|
41
91
|
with_translations(Globalize.fallbacks)
|
42
92
|
end
|
@@ -110,11 +160,19 @@ module Globalize
|
|
110
160
|
order(ordering).order_values
|
111
161
|
when Symbol
|
112
162
|
parse_translated_order({ opts => :asc })
|
163
|
+
when Array
|
164
|
+
parse_translated_order(Hash[opts.collect { |opt| [opt, :asc] } ])
|
113
165
|
else # failsafe returns nothing
|
114
166
|
nil
|
115
167
|
end
|
116
168
|
end
|
117
169
|
|
170
|
+
def parse_translated_columns(columns)
|
171
|
+
if columns.is_a?(Array) && (columns.flatten & translated_attribute_names).present?
|
172
|
+
columns.flatten.map { |column| translated_column?(column) ? translated_column_name(column) : column }
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
118
176
|
def translated_column?(column)
|
119
177
|
translated_attribute_names.include?(column)
|
120
178
|
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:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Fuchs
|
@@ -11,10 +11,36 @@ authors:
|
|
11
11
|
- Tomasz Stachewicz
|
12
12
|
- Philip Arndt
|
13
13
|
- Chris Salzberg
|
14
|
-
autorequire:
|
14
|
+
autorequire:
|
15
15
|
bindir: bin
|
16
|
-
cert_chain:
|
17
|
-
|
16
|
+
cert_chain:
|
17
|
+
- |
|
18
|
+
-----BEGIN CERTIFICATE-----
|
19
|
+
MIIEMjCCApqgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhnZW1z
|
20
|
+
L0RDPXAvREM9YXJuZHQvREM9aW8wHhcNMjAwNTEwMjIxOTQ2WhcNMjEwNTEwMjIx
|
21
|
+
OTQ2WjAjMSEwHwYDVQQDDBhnZW1zL0RDPXAvREM9YXJuZHQvREM9aW8wggGiMA0G
|
22
|
+
CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDT+JzHYPGMYJt9ct2DCsbIymn1uJJp
|
23
|
+
HnDkQESfsGe40jTC90oF2iVbVOkaacNc1N3CSWUZvZjuygUuS86P6/kpBILGdO2+
|
24
|
+
bkXXKtfGC2YGGx9TdNLpCb4925vQHvdFeKXGpQDZdDw1SNC6zraZou47CvOE1cl2
|
25
|
+
Bp+1QMZuGRZ4+5CzOEWDWurjqce3O1jUEbyBB7z5H0h/YEaxfXipxhL1Dhi0sgkH
|
26
|
+
qP/e6SxzifdifdZCksJFQ06a1ji9hJY6eM23qbv/aaluVHAZSVBAQBS7rYniLo+N
|
27
|
+
G4vpFhoubQO5u8UluUtCaPUpI/qOvVcSaZn3ZkzlMwC8b1RwAeXBQmtFE2wnrv2i
|
28
|
+
ovTwoN7rHchwhgaHbkuFh4Wr92wGbrWL7J+X8rWKk1f8RF4kvtNE/NA6YrkxTpVh
|
29
|
+
QMyDmekt7rTxvcq2NneLGroWIUVCx/JID+Jw492LKQ6Sl1/P2TRzdEDtqZAZL0gt
|
30
|
+
xlWeMUfGG2D/gLnhs5qnaFaWQwGTmBnTgHcCAwEAAaNxMG8wCQYDVR0TBAIwADAL
|
31
|
+
BgNVHQ8EBAMCBLAwHQYDVR0OBBYEFEqtAyQVxPgKsrgoTQ1YmaIu/fmvMBoGA1Ud
|
32
|
+
EQQTMBGBD2dlbXNAcC5hcm5kdC5pbzAaBgNVHRIEEzARgQ9nZW1zQHAuYXJuZHQu
|
33
|
+
aW8wDQYJKoZIhvcNAQELBQADggGBALu2HM50B8xqlAXkCwavJDvWWtV9pG1igFUg
|
34
|
+
friZRWprUQ5nTaNmAd8p8qbJQwaIK2gt+DfYWfB9LtKnQTfbhLRBbmJ7zYw8LjKY
|
35
|
+
PwCs4RWjDAiuyCO3ppfsz+1bsMUXPLgWlaUkXsUy3nr2NruEFTO9zu3wGYQQ93Tt
|
36
|
+
vYSHOnP35UB4QjsjNrOO7FBaQfy6O909PP+GnVcJ62s9c26voJz63RSolwY7Jydw
|
37
|
+
XUlG68jjJKSoDHRzVTmNB7sX8rs8P2kvYkpIUXPHyls3mWBWjBWbdEYWESZrxI2x
|
38
|
+
dS7jY3AnfqhvsWra2pSREb2IDqPnJrHVOejnEI/zuuufUxLwDx3AC6SMdsyWkZ7V
|
39
|
+
9OmLt2rg75Sct6h2220lO5ySqYtqAXuOMBDGv5L0zLalx1g8LACA7uILTKVWh8B8
|
40
|
+
Hsej0MQ3drCB1eA4c9OXdCUQJnY2aLTq3uNvTbZvoTgWK55eq3KLBJ4zzoKZ4tBX
|
41
|
+
/HIFI/fEwYlI1Ji3oikUrHkc4rWgaQ==
|
42
|
+
-----END CERTIFICATE-----
|
43
|
+
date: 2021-01-11 00:00:00.000000000 Z
|
18
44
|
dependencies:
|
19
45
|
- !ruby/object:Gem::Dependency
|
20
46
|
name: activerecord
|
@@ -25,7 +51,7 @@ dependencies:
|
|
25
51
|
version: '4.2'
|
26
52
|
- - "<"
|
27
53
|
- !ruby/object:Gem::Version
|
28
|
-
version: '
|
54
|
+
version: '7.0'
|
29
55
|
type: :runtime
|
30
56
|
prerelease: false
|
31
57
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -35,7 +61,7 @@ dependencies:
|
|
35
61
|
version: '4.2'
|
36
62
|
- - "<"
|
37
63
|
- !ruby/object:Gem::Version
|
38
|
-
version: '
|
64
|
+
version: '7.0'
|
39
65
|
- !ruby/object:Gem::Dependency
|
40
66
|
name: activemodel
|
41
67
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,7 +71,7 @@ dependencies:
|
|
45
71
|
version: '4.2'
|
46
72
|
- - "<"
|
47
73
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
74
|
+
version: '7.0'
|
49
75
|
type: :runtime
|
50
76
|
prerelease: false
|
51
77
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -55,7 +81,7 @@ dependencies:
|
|
55
81
|
version: '4.2'
|
56
82
|
- - "<"
|
57
83
|
- !ruby/object:Gem::Version
|
58
|
-
version: '
|
84
|
+
version: '7.0'
|
59
85
|
- !ruby/object:Gem::Dependency
|
60
86
|
name: request_store
|
61
87
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,6 +96,20 @@ dependencies:
|
|
70
96
|
- - "~>"
|
71
97
|
- !ruby/object:Gem::Version
|
72
98
|
version: '1.0'
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: appraisal
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
type: :development
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
73
113
|
- !ruby/object:Gem::Dependency
|
74
114
|
name: database_cleaner
|
75
115
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,6 +124,20 @@ dependencies:
|
|
84
124
|
- - ">="
|
85
125
|
- !ruby/object:Gem::Version
|
86
126
|
version: '0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: m
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
87
141
|
- !ruby/object:Gem::Dependency
|
88
142
|
name: minitest
|
89
143
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,7 +167,7 @@ dependencies:
|
|
113
167
|
- !ruby/object:Gem::Version
|
114
168
|
version: '0'
|
115
169
|
- !ruby/object:Gem::Dependency
|
116
|
-
name:
|
170
|
+
name: pry
|
117
171
|
requirement: !ruby/object:Gem::Requirement
|
118
172
|
requirements:
|
119
173
|
- - ">="
|
@@ -140,19 +194,36 @@ dependencies:
|
|
140
194
|
- - ">="
|
141
195
|
- !ruby/object:Gem::Version
|
142
196
|
version: '0'
|
197
|
+
- !ruby/object:Gem::Dependency
|
198
|
+
name: rdoc
|
199
|
+
requirement: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - ">="
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
type: :development
|
205
|
+
prerelease: false
|
206
|
+
version_requirements: !ruby/object:Gem::Requirement
|
207
|
+
requirements:
|
208
|
+
- - ">="
|
209
|
+
- !ruby/object:Gem::Version
|
210
|
+
version: '0'
|
143
211
|
description: Rails I18n de-facto standard library for ActiveRecord model/data translation.
|
144
212
|
email: nobody@globalize-rails.org
|
145
213
|
executables: []
|
146
214
|
extensions: []
|
147
215
|
extra_rdoc_files: []
|
148
216
|
files:
|
217
|
+
- Appraisals
|
149
218
|
- CHANGELOG.md
|
150
219
|
- CONTRIBUTING.md
|
151
220
|
- Gemfile
|
152
|
-
- Gemfile.lock
|
153
221
|
- LICENSE
|
154
222
|
- README.md
|
155
223
|
- Rakefile
|
224
|
+
- docker-compose.yml
|
225
|
+
- globalize.gemspec
|
226
|
+
- issue_template.rb
|
156
227
|
- lib/globalize.rb
|
157
228
|
- lib/globalize/active_record.rb
|
158
229
|
- lib/globalize/active_record/act_macro.rb
|
@@ -163,7 +234,7 @@ files:
|
|
163
234
|
- lib/globalize/active_record/exceptions.rb
|
164
235
|
- lib/globalize/active_record/instance_methods.rb
|
165
236
|
- lib/globalize/active_record/migration.rb
|
166
|
-
- lib/globalize/active_record/
|
237
|
+
- lib/globalize/active_record/translated_attributes_query.rb
|
167
238
|
- lib/globalize/active_record/translation.rb
|
168
239
|
- lib/globalize/interpolation.rb
|
169
240
|
- lib/globalize/version.rb
|
@@ -185,7 +256,7 @@ homepage: http://github.com/globalize/globalize
|
|
185
256
|
licenses:
|
186
257
|
- MIT
|
187
258
|
metadata: {}
|
188
|
-
post_install_message:
|
259
|
+
post_install_message:
|
189
260
|
rdoc_options: []
|
190
261
|
require_paths:
|
191
262
|
- lib
|
@@ -193,16 +264,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
193
264
|
requirements:
|
194
265
|
- - ">="
|
195
266
|
- !ruby/object:Gem::Version
|
196
|
-
version: 2.
|
267
|
+
version: 2.4.6
|
197
268
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
269
|
requirements:
|
199
270
|
- - ">="
|
200
271
|
- !ruby/object:Gem::Version
|
201
272
|
version: '0'
|
202
273
|
requirements: []
|
203
|
-
|
204
|
-
|
205
|
-
signing_key:
|
274
|
+
rubygems_version: 3.2.3
|
275
|
+
signing_key:
|
206
276
|
specification_version: 4
|
207
277
|
summary: Rails I18n de-facto standard library for ActiveRecord model/data translation
|
208
278
|
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|
data/Gemfile.lock
DELETED
@@ -1,314 +0,0 @@
|
|
1
|
-
GIT
|
2
|
-
remote: https://github.com/jruby/activerecord-jdbc-adapter
|
3
|
-
revision: 4ae8a3c4d4b00d1c33ef6b9099f63a3f78da21ad
|
4
|
-
specs:
|
5
|
-
activerecord-jdbc-adapter (51.0)
|
6
|
-
activerecord (~> 5.1.0)
|
7
|
-
activerecord-jdbcmysql-adapter (51.0)
|
8
|
-
activerecord-jdbc-adapter (~> 51.0)
|
9
|
-
jdbc-mysql (~> 5.1.36)
|
10
|
-
activerecord-jdbcpostgresql-adapter (51.0)
|
11
|
-
activerecord-jdbc-adapter (~> 51.0)
|
12
|
-
jdbc-postgres (>= 9.4, < 43)
|
13
|
-
activerecord-jdbcsqlite3-adapter (51.0)
|
14
|
-
activerecord-jdbc-adapter (~> 51.0)
|
15
|
-
jdbc-sqlite3 (~> 3.8, < 3.30)
|
16
|
-
jdbc-mysql (5.1.44)
|
17
|
-
jdbc-postgres (42.1.4)
|
18
|
-
jdbc-sqlite3 (3.20.1)
|
19
|
-
|
20
|
-
PATH
|
21
|
-
remote: .
|
22
|
-
specs:
|
23
|
-
globalize (5.1.0)
|
24
|
-
activemodel (>= 4.2, < 5.2)
|
25
|
-
activerecord (>= 4.2, < 5.2)
|
26
|
-
request_store (~> 1.0)
|
27
|
-
|
28
|
-
GEM
|
29
|
-
remote: https://rubygems.org/
|
30
|
-
specs:
|
31
|
-
activemodel (5.1.4)
|
32
|
-
activesupport (= 5.1.4)
|
33
|
-
activerecord (5.1.4)
|
34
|
-
activemodel (= 5.1.4)
|
35
|
-
activesupport (= 5.1.4)
|
36
|
-
arel (~> 8.0)
|
37
|
-
activesupport (5.1.4)
|
38
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
39
|
-
i18n (~> 0.7)
|
40
|
-
minitest (~> 5.1)
|
41
|
-
tzinfo (~> 1.1)
|
42
|
-
ansi (1.5.0)
|
43
|
-
arel (8.0.0)
|
44
|
-
builder (3.2.3)
|
45
|
-
coderay (1.1.2)
|
46
|
-
concurrent-ruby (1.0.5)
|
47
|
-
concurrent-ruby (1.0.5-java)
|
48
|
-
database_cleaner (1.6.2)
|
49
|
-
ffi (1.9.18-java)
|
50
|
-
ffi2-generators (0.1.1)
|
51
|
-
i18n (0.9.1)
|
52
|
-
concurrent-ruby (~> 1.0)
|
53
|
-
method_source (0.9.0)
|
54
|
-
minitest (5.11.1)
|
55
|
-
minitest-reporters (1.1.19)
|
56
|
-
ansi
|
57
|
-
builder
|
58
|
-
minitest (>= 5.0)
|
59
|
-
ruby-progressbar
|
60
|
-
mysql2 (0.4.10)
|
61
|
-
pg (1.0.0)
|
62
|
-
pry (0.11.3)
|
63
|
-
coderay (~> 1.1.0)
|
64
|
-
method_source (~> 0.9.0)
|
65
|
-
pry (0.11.3-java)
|
66
|
-
coderay (~> 1.1.0)
|
67
|
-
method_source (~> 0.9.0)
|
68
|
-
spoon (~> 0.0)
|
69
|
-
rack (2.0.3)
|
70
|
-
rake (12.3.0)
|
71
|
-
rdoc (6.0.1)
|
72
|
-
request_store (1.4.0)
|
73
|
-
rack (>= 1.4)
|
74
|
-
rubinius-coverage (2.1)
|
75
|
-
rubinius-debugger (2.6)
|
76
|
-
rubinius-developer_tools (2.0.0)
|
77
|
-
rubinius-coverage (~> 2.0)
|
78
|
-
rubinius-debugger (~> 2.0)
|
79
|
-
rubinius-profiler (~> 2.0)
|
80
|
-
rubinius-profiler (2.1)
|
81
|
-
ruby-progressbar (1.9.0)
|
82
|
-
rubysl (2.2.0)
|
83
|
-
rubysl-abbrev (~> 2.0)
|
84
|
-
rubysl-base64 (~> 2.0)
|
85
|
-
rubysl-benchmark (~> 2.0)
|
86
|
-
rubysl-bigdecimal (~> 2.0)
|
87
|
-
rubysl-cgi (~> 2.0)
|
88
|
-
rubysl-cgi-session (~> 2.0)
|
89
|
-
rubysl-cmath (~> 2.0)
|
90
|
-
rubysl-complex (~> 2.0)
|
91
|
-
rubysl-continuation (~> 2.0)
|
92
|
-
rubysl-coverage (~> 2.0)
|
93
|
-
rubysl-csv (~> 2.0)
|
94
|
-
rubysl-curses (~> 2.0)
|
95
|
-
rubysl-date (~> 2.0)
|
96
|
-
rubysl-delegate (~> 2.0)
|
97
|
-
rubysl-digest (~> 2.0)
|
98
|
-
rubysl-drb (~> 2.0)
|
99
|
-
rubysl-e2mmap (~> 2.0)
|
100
|
-
rubysl-english (~> 2.0)
|
101
|
-
rubysl-enumerator (~> 2.0)
|
102
|
-
rubysl-erb (~> 2.0)
|
103
|
-
rubysl-etc (~> 2.0)
|
104
|
-
rubysl-expect (~> 2.0)
|
105
|
-
rubysl-fcntl (~> 2.0)
|
106
|
-
rubysl-fiber (~> 2.0)
|
107
|
-
rubysl-fileutils (~> 2.0)
|
108
|
-
rubysl-find (~> 2.0)
|
109
|
-
rubysl-forwardable (~> 2.0)
|
110
|
-
rubysl-getoptlong (~> 2.0)
|
111
|
-
rubysl-gserver (~> 2.0)
|
112
|
-
rubysl-io-console (~> 2.0)
|
113
|
-
rubysl-io-nonblock (~> 2.0)
|
114
|
-
rubysl-io-wait (~> 2.0)
|
115
|
-
rubysl-ipaddr (~> 2.0)
|
116
|
-
rubysl-irb (~> 2.1)
|
117
|
-
rubysl-logger (~> 2.0)
|
118
|
-
rubysl-mathn (~> 2.0)
|
119
|
-
rubysl-matrix (~> 2.0)
|
120
|
-
rubysl-mkmf (~> 2.0)
|
121
|
-
rubysl-monitor (~> 2.0)
|
122
|
-
rubysl-mutex_m (~> 2.0)
|
123
|
-
rubysl-net-ftp (~> 2.0)
|
124
|
-
rubysl-net-http (~> 2.0)
|
125
|
-
rubysl-net-imap (~> 2.0)
|
126
|
-
rubysl-net-pop (~> 2.0)
|
127
|
-
rubysl-net-protocol (~> 2.0)
|
128
|
-
rubysl-net-smtp (~> 2.0)
|
129
|
-
rubysl-net-telnet (~> 2.0)
|
130
|
-
rubysl-nkf (~> 2.0)
|
131
|
-
rubysl-observer (~> 2.0)
|
132
|
-
rubysl-open-uri (~> 2.0)
|
133
|
-
rubysl-open3 (~> 2.0)
|
134
|
-
rubysl-openssl (~> 2.0)
|
135
|
-
rubysl-optparse (~> 2.0)
|
136
|
-
rubysl-ostruct (~> 2.0)
|
137
|
-
rubysl-pathname (~> 2.0)
|
138
|
-
rubysl-prettyprint (~> 2.0)
|
139
|
-
rubysl-prime (~> 2.0)
|
140
|
-
rubysl-profile (~> 2.0)
|
141
|
-
rubysl-profiler (~> 2.0)
|
142
|
-
rubysl-pstore (~> 2.0)
|
143
|
-
rubysl-pty (~> 2.0)
|
144
|
-
rubysl-rational (~> 2.0)
|
145
|
-
rubysl-resolv (~> 2.0)
|
146
|
-
rubysl-rexml (~> 2.0)
|
147
|
-
rubysl-rinda (~> 2.0)
|
148
|
-
rubysl-rss (~> 2.0)
|
149
|
-
rubysl-scanf (~> 2.0)
|
150
|
-
rubysl-securerandom (~> 2.0)
|
151
|
-
rubysl-set (~> 2.0)
|
152
|
-
rubysl-shellwords (~> 2.0)
|
153
|
-
rubysl-singleton (~> 2.0)
|
154
|
-
rubysl-socket (~> 2.0)
|
155
|
-
rubysl-stringio (~> 2.0)
|
156
|
-
rubysl-strscan (~> 2.0)
|
157
|
-
rubysl-sync (~> 2.0)
|
158
|
-
rubysl-syslog (~> 2.0)
|
159
|
-
rubysl-tempfile (~> 2.0)
|
160
|
-
rubysl-thread (~> 2.0)
|
161
|
-
rubysl-thwait (~> 2.0)
|
162
|
-
rubysl-time (~> 2.0)
|
163
|
-
rubysl-timeout (~> 2.0)
|
164
|
-
rubysl-tmpdir (~> 2.0)
|
165
|
-
rubysl-tsort (~> 2.0)
|
166
|
-
rubysl-un (~> 2.0)
|
167
|
-
rubysl-unicode_normalize (~> 2.0)
|
168
|
-
rubysl-uri (~> 2.0)
|
169
|
-
rubysl-weakref (~> 2.0)
|
170
|
-
rubysl-webrick (~> 2.0)
|
171
|
-
rubysl-xmlrpc (~> 2.0)
|
172
|
-
rubysl-yaml (~> 2.0)
|
173
|
-
rubysl-zlib (~> 2.0)
|
174
|
-
rubysl-abbrev (2.0.4)
|
175
|
-
rubysl-base64 (2.0.0)
|
176
|
-
rubysl-benchmark (2.0.1)
|
177
|
-
rubysl-bigdecimal (2.0.2)
|
178
|
-
rubysl-cgi (2.0.1)
|
179
|
-
rubysl-cgi-session (2.1.0)
|
180
|
-
rubysl-cmath (2.0.0)
|
181
|
-
rubysl-complex (2.0.0)
|
182
|
-
rubysl-continuation (2.0.0)
|
183
|
-
rubysl-coverage (2.1)
|
184
|
-
rubysl-csv (2.0.2)
|
185
|
-
rubysl-english (~> 2.0)
|
186
|
-
rubysl-curses (2.0.1)
|
187
|
-
rubysl-date (2.0.9)
|
188
|
-
rubysl-delegate (2.0.1)
|
189
|
-
rubysl-digest (2.0.8)
|
190
|
-
rubysl-drb (2.0.1)
|
191
|
-
rubysl-e2mmap (2.0.0)
|
192
|
-
rubysl-english (2.0.0)
|
193
|
-
rubysl-enumerator (2.0.0)
|
194
|
-
rubysl-erb (2.0.2)
|
195
|
-
rubysl-etc (2.0.3)
|
196
|
-
ffi2-generators (~> 0.1)
|
197
|
-
rubysl-expect (2.0.0)
|
198
|
-
rubysl-fcntl (2.0.4)
|
199
|
-
ffi2-generators (~> 0.1)
|
200
|
-
rubysl-fiber (2.0.0)
|
201
|
-
rubysl-fileutils (2.0.3)
|
202
|
-
rubysl-find (2.0.1)
|
203
|
-
rubysl-forwardable (2.0.1)
|
204
|
-
rubysl-getoptlong (2.0.0)
|
205
|
-
rubysl-gserver (2.0.0)
|
206
|
-
rubysl-socket (~> 2.0)
|
207
|
-
rubysl-thread (~> 2.0)
|
208
|
-
rubysl-io-console (2.0.0)
|
209
|
-
rubysl-io-nonblock (2.0.0)
|
210
|
-
rubysl-io-wait (2.0.0)
|
211
|
-
rubysl-ipaddr (2.0.0)
|
212
|
-
rubysl-irb (2.1.1)
|
213
|
-
rubysl-e2mmap (~> 2.0)
|
214
|
-
rubysl-mathn (~> 2.0)
|
215
|
-
rubysl-thread (~> 2.0)
|
216
|
-
rubysl-logger (2.1.0)
|
217
|
-
rubysl-mathn (2.0.0)
|
218
|
-
rubysl-matrix (2.1.0)
|
219
|
-
rubysl-e2mmap (~> 2.0)
|
220
|
-
rubysl-mkmf (2.1)
|
221
|
-
rubysl-fileutils (~> 2.0)
|
222
|
-
rubysl-shellwords (~> 2.0)
|
223
|
-
rubysl-monitor (2.1)
|
224
|
-
rubysl-mutex_m (2.0.0)
|
225
|
-
rubysl-net-ftp (2.0.1)
|
226
|
-
rubysl-net-http (2.0.4)
|
227
|
-
rubysl-cgi (~> 2.0)
|
228
|
-
rubysl-erb (~> 2.0)
|
229
|
-
rubysl-singleton (~> 2.0)
|
230
|
-
rubysl-net-imap (2.0.1)
|
231
|
-
rubysl-net-pop (2.0.1)
|
232
|
-
rubysl-net-protocol (2.0.1)
|
233
|
-
rubysl-net-smtp (2.0.1)
|
234
|
-
rubysl-net-telnet (2.0.0)
|
235
|
-
rubysl-nkf (2.0.1)
|
236
|
-
rubysl-observer (2.0.0)
|
237
|
-
rubysl-open-uri (2.0.0)
|
238
|
-
rubysl-open3 (2.0.0)
|
239
|
-
rubysl-openssl (2.9)
|
240
|
-
rubysl-optparse (2.0.1)
|
241
|
-
rubysl-shellwords (~> 2.0)
|
242
|
-
rubysl-ostruct (2.1.0)
|
243
|
-
rubysl-pathname (2.3)
|
244
|
-
rubysl-prettyprint (2.0.3)
|
245
|
-
rubysl-prime (2.0.1)
|
246
|
-
rubysl-profile (2.0.0)
|
247
|
-
rubysl-profiler (2.1)
|
248
|
-
rubysl-pstore (2.0.0)
|
249
|
-
rubysl-pty (2.0.3)
|
250
|
-
rubysl-rational (2.0.1)
|
251
|
-
rubysl-resolv (2.1.2)
|
252
|
-
rubysl-rexml (2.0.4)
|
253
|
-
rubysl-rinda (2.0.1)
|
254
|
-
rubysl-rss (2.0.0)
|
255
|
-
rubysl-scanf (2.0.0)
|
256
|
-
rubysl-securerandom (2.0.0)
|
257
|
-
rubysl-set (2.0.1)
|
258
|
-
rubysl-shellwords (2.0.0)
|
259
|
-
rubysl-singleton (2.0.0)
|
260
|
-
rubysl-socket (2.2.1)
|
261
|
-
rubysl-fcntl (~> 2.0)
|
262
|
-
rubysl-stringio (2.2)
|
263
|
-
rubysl-strscan (2.0.0)
|
264
|
-
rubysl-sync (2.0.0)
|
265
|
-
rubysl-syslog (2.1.0)
|
266
|
-
ffi2-generators (~> 0.1)
|
267
|
-
rubysl-tempfile (2.0.1)
|
268
|
-
rubysl-thread (2.1)
|
269
|
-
rubysl-thwait (2.0.0)
|
270
|
-
rubysl-time (2.0.3)
|
271
|
-
rubysl-timeout (2.0.0)
|
272
|
-
rubysl-tmpdir (2.0.1)
|
273
|
-
rubysl-tsort (2.0.1)
|
274
|
-
rubysl-un (2.0.0)
|
275
|
-
rubysl-fileutils (~> 2.0)
|
276
|
-
rubysl-optparse (~> 2.0)
|
277
|
-
rubysl-unicode_normalize (2.0)
|
278
|
-
rubysl-uri (2.0.0)
|
279
|
-
rubysl-weakref (2.0.0)
|
280
|
-
rubysl-webrick (2.0.0)
|
281
|
-
rubysl-xmlrpc (2.0.0)
|
282
|
-
rubysl-yaml (2.1.0)
|
283
|
-
rubysl-zlib (2.0.1)
|
284
|
-
spoon (0.0.6)
|
285
|
-
ffi
|
286
|
-
sqlite3 (1.3.13)
|
287
|
-
thread_safe (0.3.6)
|
288
|
-
thread_safe (0.3.6-java)
|
289
|
-
tzinfo (1.2.4)
|
290
|
-
thread_safe (~> 0.1)
|
291
|
-
|
292
|
-
PLATFORMS
|
293
|
-
java
|
294
|
-
ruby
|
295
|
-
|
296
|
-
DEPENDENCIES
|
297
|
-
activerecord-jdbcmysql-adapter!
|
298
|
-
activerecord-jdbcpostgresql-adapter!
|
299
|
-
activerecord-jdbcsqlite3-adapter!
|
300
|
-
database_cleaner
|
301
|
-
globalize!
|
302
|
-
minitest
|
303
|
-
minitest-reporters
|
304
|
-
mysql2
|
305
|
-
pg
|
306
|
-
pry
|
307
|
-
rake
|
308
|
-
rdoc
|
309
|
-
rubinius-developer_tools
|
310
|
-
rubysl (~> 2.0)
|
311
|
-
sqlite3
|
312
|
-
|
313
|
-
BUNDLED WITH
|
314
|
-
1.16.1
|