globalize 5.3.0 → 6.0.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a9c4607049c3148c7776b5042d30484e64a37a5ae8db707063a12feaaad58cb
4
- data.tar.gz: beb3e48916b787e972626b9372dd72124ef332481db3ad2d62d156091546bb21
3
+ metadata.gz: bb12d7f3b6c17018cefe1614dfba6b585ba169ef2ca412b58d230ccabf778033
4
+ data.tar.gz: ac44f2e8a75b53ad116b8674d1f5c3d47a122c9782133e3853359217fb944375
5
5
  SHA512:
6
- metadata.gz: 66ba0dce842a6fb7b12ff23faaa2fcd834b586e94bc4c2f7e7bcddc5be97f48c697a08fc861b961dbc97172aa79939a08aa5ea567ea0a37fc04e4c5cfee330b0
7
- data.tar.gz: 738d84f3776f6529bb13b67012d8bc780a4ce7eff465c193738f715c92e60095f0c90d70be3a9c1f9311467533009214d41f628c4b9b243f2fa514457c240d5a
6
+ metadata.gz: 2f358f026bc47645ae8751cb3b2a3a7660cfbbb64c6c37e2ab2b46a9b548de357ba0e8a8880eb82326ce78c6e7605c31fbf27726d645b33baa62c594bace13b5
7
+ data.tar.gz: 185fbeea91d8fda53c23232897deba40ad149fbea99c329a32aa8d9bbd7c296c4b9a5a814ced76d39785969d8503011f9316bc600a07de7e82b1a03fe0c3a76a
data/Appraisals CHANGED
@@ -17,15 +17,15 @@ RAILS_VERSIONS.each do |version|
17
17
  end
18
18
 
19
19
  platforms :jruby do
20
- if !ENV['TRAVIS'] || ENV['DB'] == 'sqlite3'
20
+ if !ENV['CI'] || ENV['DB'] == 'sqlite3'
21
21
  gem 'activerecord-jdbcsqlite3-adapter', '~> 1'
22
22
  end
23
23
 
24
- if !ENV['TRAVIS'] || ENV['DB'] == 'mysql'
24
+ if !ENV['CI'] || ENV['DB'] == 'mysql'
25
25
  gem 'activerecord-jdbcmysql-adapter', '~> 1'
26
26
  end
27
27
 
28
- if !ENV['TRAVIS'] || %w(postgres postgresql).include?(ENV['DB'])
28
+ if !ENV['CI'] || %w(postgres postgresql).include?(ENV['DB'])
29
29
  gem 'activerecord-jdbcpostgresql-adapter', '~> 1'
30
30
  end
31
31
  end
@@ -1,5 +1,27 @@
1
1
  # Globalize Changelog
2
2
 
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
+
8
+ ## 5.3.0 (2019-05-14)
9
+
10
+ * 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)
11
+ * Pass the `:limit` option for the FK column. [#721](https://github.com/globalize/globalize/pull/721) by [Denis Demchenko](https://github.com/lancedikson)
12
+ * Add support for Rails 6.0. [#718](https://github.com/globalize/globalize/pull/718) by [Chrıs Seelus](https://github.com/cseelus)
13
+ * FIX: stop registering the attr for Rails 4.2. [#711](https://github.com/globalize/globalize/pull/711) by [Adam Fernung](https://github.com/akfernun)
14
+
15
+ ## 5.2.0 (2018-11-02)
16
+
17
+ * Add support for translated attributes to other QueryMethods and Calculations [#707](https://github.com/globalize/globalize/pull/707) by [kreintjes](https://github.com/kreintjes)
18
+ * 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)
19
+ * Support array as an argument of order. [#675](https://github.com/globalize/globalize/pull/675) by [Maicol Bentancor](https://github.com/MaicolBen)
20
+ * `_reset_attribute` bugfix. [#674](https://github.com/globalize/globalize/pull/674) by [ota42y](https://github.com/ota42y)
21
+ * Add support for Rails 5.2 [#678](https://github.com/globalize/globalize/pull/678) by [kevin-jj](https://github.com/kevin-jj)
22
+ * Fix: wrong number of arguments for ActiveRecord 'attribute' method [#671](https://github.com/globalize/globalize/pull/671) by [Evgeny Danilov](https://github.com/jmelkor)
23
+ * 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)
24
+
3
25
  ## 5.1.0 (2018-01-15)
4
26
 
5
27
  * 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)
@@ -34,7 +34,7 @@ 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, 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.
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
38
 
39
39
  ## Testing
40
40
 
data/Gemfile CHANGED
@@ -1,3 +1,20 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ # Database Configuration
6
+ if !ENV['CI'] || ENV['DB'] == 'sqlite3'
7
+ gem 'sqlite3', platforms: [:ruby, :rbx]
8
+ end
9
+
10
+ if !ENV['CI'] || ENV['DB'] == 'mysql'
11
+ group :mysql do
12
+ gem 'mysql2', platforms: [:ruby, :rbx]
13
+ end
14
+ end
15
+
16
+ if !ENV['CI'] || %w(postgres postgresql).include?(ENV['DB'])
17
+ group :postgres, :postgresql do
18
+ gem 'pg', '< 1.0', platforms: [:ruby, :rbx]
19
+ end
20
+ end
@@ -9,53 +9,55 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activemodel (5.2.3)
13
- activesupport (= 5.2.3)
14
- activerecord (5.2.3)
15
- activemodel (= 5.2.3)
16
- activesupport (= 5.2.3)
17
- arel (>= 9.0)
18
- activesupport (5.2.3)
12
+ activemodel (6.0.2.1)
13
+ activesupport (= 6.0.2.1)
14
+ activerecord (6.0.2.1)
15
+ activemodel (= 6.0.2.1)
16
+ activesupport (= 6.0.2.1)
17
+ activesupport (6.0.2.1)
19
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
19
  i18n (>= 0.7, < 2)
21
20
  minitest (~> 5.1)
22
21
  tzinfo (~> 1.1)
22
+ zeitwerk (~> 2.2)
23
23
  ansi (1.5.0)
24
24
  appraisal (2.2.0)
25
25
  bundler
26
26
  rake
27
27
  thor (>= 0.14.0)
28
- arel (9.0.0)
29
- builder (3.2.3)
28
+ builder (3.2.4)
30
29
  coderay (1.1.2)
31
- concurrent-ruby (1.1.5)
32
- database_cleaner (1.7.0)
33
- i18n (1.6.0)
30
+ concurrent-ruby (1.1.6)
31
+ database_cleaner (1.8.2)
32
+ i18n (1.8.2)
34
33
  concurrent-ruby (~> 1.0)
35
34
  m (1.5.1)
36
35
  method_source (>= 0.6.7)
37
36
  rake (>= 0.9.2.2)
38
37
  method_source (0.9.2)
39
- minitest (5.11.3)
40
- minitest-reporters (1.3.6)
38
+ minitest (5.14.0)
39
+ minitest-reporters (1.4.2)
41
40
  ansi
42
41
  builder
43
42
  minitest (>= 5.0)
44
43
  ruby-progressbar
44
+ mysql2 (0.5.3)
45
+ pg (0.21.0)
45
46
  pry (0.12.2)
46
47
  coderay (~> 1.1.0)
47
48
  method_source (~> 0.9.0)
48
- rack (2.0.7)
49
- rake (12.3.2)
50
- rdoc (6.1.1)
51
- request_store (1.4.1)
49
+ rack (2.2.2)
50
+ rake (13.0.1)
51
+ rdoc (6.2.1)
52
+ request_store (1.5.0)
52
53
  rack (>= 1.4)
53
- ruby-progressbar (1.10.0)
54
- sqlite3 (1.4.1)
55
- thor (0.20.3)
54
+ ruby-progressbar (1.10.1)
55
+ sqlite3 (1.4.2)
56
+ thor (1.0.1)
56
57
  thread_safe (0.3.6)
57
- tzinfo (1.2.5)
58
+ tzinfo (1.2.6)
58
59
  thread_safe (~> 0.1)
60
+ zeitwerk (2.2.2)
59
61
 
60
62
  PLATFORMS
61
63
  ruby
@@ -67,10 +69,12 @@ DEPENDENCIES
67
69
  m
68
70
  minitest
69
71
  minitest-reporters
72
+ mysql2
73
+ pg (< 1.0)
70
74
  pry
71
75
  rake
72
76
  rdoc
73
77
  sqlite3
74
78
 
75
79
  BUNDLED WITH
76
- 2.0.1
80
+ 2.1.4
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![Globalize](http://globalize.github.io/globalize/images/globalize.png)
2
2
 
3
- [![Build Status](https://travis-ci.org/globalize/globalize.svg?branch=master)](https://travis-ci.org/globalize/globalize) [![Code Climate](https://codeclimate.com/github/globalize/globalize.svg)](https://codeclimate.com/github/globalize/globalize)
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
4
  [![Open Source Helpers](https://www.codetriage.com/globalize/globalize/badges/users.svg)](https://www.codetriage.com/globalize/globalize)
5
5
 
6
6
  You can chat with us using Gitter:
@@ -28,7 +28,7 @@ gem install globalize
28
28
  When using bundler put this in your Gemfile:
29
29
 
30
30
  ```ruby
31
- gem 'globalize', '~> 5.1.0'
31
+ gem 'globalize', '~> 5.3.0'
32
32
  ```
33
33
 
34
34
  Please help us by letting us know what works, and what doesn't, when using pre-release code.
@@ -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,7 +100,7 @@ module Globalize
99
100
  :foreign_key => options[:foreign_key],
100
101
  :dependent => :destroy,
101
102
  :extend => HasManyExtensions,
102
- :autosave => false,
103
+ :autosave => options[:autosave],
103
104
  :inverse_of => :globalized_model
104
105
 
105
106
  after_create :save_translations!
@@ -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
@@ -148,8 +149,6 @@ module Globalize
148
149
  end
149
150
 
150
151
  def move_data_to_model_table
151
- add_missing_columns
152
-
153
152
  # Find all of the translated attributes for all records in the model.
154
153
  all_translated_attributes = model.all.collect{|m| m.attributes}
155
154
  all_translated_attributes.each do |translated_record|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Globalize
4
- Version = '5.3.0'
4
+ Version = '6.0.0.alpha.1'
5
5
  end
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: 5.3.0
4
+ version: 6.0.0.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2019-05-14 00:00:00.000000000 Z
17
+ date: 2020-04-19 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
@@ -25,7 +25,7 @@ dependencies:
25
25
  version: '4.2'
26
26
  - - "<"
27
27
  - !ruby/object:Gem::Version
28
- version: '6.1'
28
+ version: '7.0'
29
29
  type: :runtime
30
30
  prerelease: false
31
31
  version_requirements: !ruby/object:Gem::Requirement
@@ -35,7 +35,7 @@ dependencies:
35
35
  version: '4.2'
36
36
  - - "<"
37
37
  - !ruby/object:Gem::Version
38
- version: '6.1'
38
+ version: '7.0'
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: activemodel
41
41
  requirement: !ruby/object:Gem::Requirement
@@ -45,7 +45,7 @@ dependencies:
45
45
  version: '4.2'
46
46
  - - "<"
47
47
  - !ruby/object:Gem::Version
48
- version: '6.1'
48
+ version: '7.0'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: '4.2'
56
56
  - - "<"
57
57
  - !ruby/object:Gem::Version
58
- version: '6.1'
58
+ version: '7.0'
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: request_store
61
61
  requirement: !ruby/object:Gem::Requirement
@@ -182,20 +182,6 @@ dependencies:
182
182
  - - ">="
183
183
  - !ruby/object:Gem::Version
184
184
  version: '0'
185
- - !ruby/object:Gem::Dependency
186
- name: sqlite3
187
- requirement: !ruby/object:Gem::Requirement
188
- requirements:
189
- - - ">="
190
- - !ruby/object:Gem::Version
191
- version: '0'
192
- type: :development
193
- prerelease: false
194
- version_requirements: !ruby/object:Gem::Requirement
195
- requirements:
196
- - - ">="
197
- - !ruby/object:Gem::Version
198
- version: '0'
199
185
  description: Rails I18n de-facto standard library for ActiveRecord model/data translation.
200
186
  email: nobody@globalize-rails.org
201
187
  executables: []
@@ -253,9 +239,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
253
239
  version: 2.4.6
254
240
  required_rubygems_version: !ruby/object:Gem::Requirement
255
241
  requirements:
256
- - - ">="
242
+ - - ">"
257
243
  - !ruby/object:Gem::Version
258
- version: '0'
244
+ version: 1.3.1
259
245
  requirements: []
260
246
  rubygems_version: 3.0.3
261
247
  signing_key: