globalize-versioning 0.2.0 → 0.3.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
- SHA1:
3
- metadata.gz: 96220edb46d3b08f41a307f982075632f7c56020
4
- data.tar.gz: 35a8ee042f5bb66f39aa5d8afcbb7abe9335248f
2
+ SHA256:
3
+ metadata.gz: 16fc4f108a3053fd7d073d1830f7458d43c27408b245503fb0bfc6a52376de53
4
+ data.tar.gz: 0ba113a210f11712c097950060bba69f0e4f8d0be9253016791f1bc60ea00f2f
5
5
  SHA512:
6
- metadata.gz: 5869cb2fa84ae4d1de7b03a9f6d9c0d9c2d93579d54ea92277b60d4bcc8b535b92a3ac953b6b536da6b7d65cbf45aced64e219a077a16f6863c9fc8a29a95e83
7
- data.tar.gz: ec8e095a70acaec14c70a7fa01797700094e40ed1e7369240259949e7adf2d0b9149bab0145594d271d6d46726216ee10def4bab66f7bc5627066e81c70ce874
6
+ metadata.gz: 5929f571d840c7f4f4a41a206b9490ae69936b8be10e5f29605f846b0121fb1f2989321b0d5ad8f5dd1b8871e8b6f58b78eb05844c69c1cac92b53f4e5647316
7
+ data.tar.gz: 63364c4c347fa820cf8ef0bbd8ab178bb5a98efd5451d06b4d4912064149cafe73172fcfc377f659c99d8ad9af3a81e34f27f9e38574a4a3c23bf429a4be037d
data/Gemfile CHANGED
@@ -1,20 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
5
- if ENV['RAILS'] == "3.2"
6
- gem 'activerecord', '~> 3.2.0'
7
- gem 'activemodel', '~> 3.2.0'
8
- gem 'globalize', '~> 3.0.4'
9
- elsif ENV['RAILS'] == "4.0"
10
- gem 'activerecord', '~> 4.0.0'
11
- gem 'activemodel', '~> 4.0.0'
12
- gem 'globalize', '~> 4.0'
13
- elsif ENV['RAILS'] == "4.1"
14
- gem 'activerecord', '~> 4.1.0'
15
- gem 'activemodel', '~> 4.1.0'
16
- gem 'globalize', '~> 4.0'
17
- else # Rails 4.2
18
- gem 'globalize', '~> 5.0'
19
- gem 'paper_trail', '4.0.0.beta2'
20
- end
4
+ gem 'globalize', '~> 5.1'
5
+ gem 'paper_trail', '~> 10.0.1'
@@ -1,46 +1,47 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- globalize-versioning (0.2.0)
5
- activemodel (>= 3.2.0, < 5)
6
- activerecord (>= 3.2.0, < 5)
7
- globalize (>= 3.0.4, < 6)
8
- paper_trail (>= 3.0.0, < 5)
4
+ globalize-versioning (0.3.0)
5
+ activemodel (>= 4.2.0, < 6)
6
+ activerecord (>= 4.2.0, < 6)
7
+ globalize (>= 5.1.0, < 6)
8
+ paper_trail (>= 8, < 12)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activemodel (4.2.5.1)
14
- activesupport (= 4.2.5.1)
15
- builder (~> 3.1)
16
- activerecord (4.2.5.1)
17
- activemodel (= 4.2.5.1)
18
- activesupport (= 4.2.5.1)
19
- arel (~> 6.0)
20
- activesupport (4.2.5.1)
21
- i18n (~> 0.7)
22
- json (~> 1.7, >= 1.7.7)
13
+ activemodel (5.1.6)
14
+ activesupport (= 5.1.6)
15
+ activerecord (5.1.6)
16
+ activemodel (= 5.1.6)
17
+ activesupport (= 5.1.6)
18
+ arel (~> 8.0)
19
+ activesupport (5.1.6)
20
+ concurrent-ruby (~> 1.0, >= 1.0.2)
21
+ i18n (>= 0.7, < 2)
23
22
  minitest (~> 5.1)
24
- thread_safe (~> 0.3, >= 0.3.4)
25
23
  tzinfo (~> 1.1)
26
- arel (6.0.3)
27
- builder (3.2.2)
28
- database_cleaner (1.5.1)
29
- globalize (5.0.1)
30
- activemodel (>= 4.2.0, < 4.3)
31
- activerecord (>= 4.2.0, < 4.3)
32
- i18n (0.7.0)
33
- json (1.8.3)
34
- minitest (5.8.4)
35
- paper_trail (4.0.0.beta2)
36
- activerecord (>= 3.0, < 6.0)
37
- activesupport (>= 3.0, < 6.0)
38
- rake (10.5.0)
39
- rdoc (4.2.2)
40
- json (~> 1.4)
41
- sqlite3 (1.3.11)
42
- thread_safe (0.3.5)
43
- tzinfo (1.2.2)
24
+ arel (8.0.0)
25
+ concurrent-ruby (1.0.5)
26
+ database_cleaner (1.7.0)
27
+ globalize (5.1.0)
28
+ activemodel (>= 4.2, < 5.2)
29
+ activerecord (>= 4.2, < 5.2)
30
+ request_store (~> 1.0)
31
+ i18n (1.1.0)
32
+ concurrent-ruby (~> 1.0)
33
+ minitest (5.11.3)
34
+ paper_trail (10.0.1)
35
+ activerecord (>= 4.2, < 5.3)
36
+ request_store (~> 1.1)
37
+ rack (2.0.5)
38
+ rake (12.3.1)
39
+ rdoc (6.0.4)
40
+ request_store (1.4.1)
41
+ rack (>= 1.4)
42
+ sqlite3 (1.3.13)
43
+ thread_safe (0.3.6)
44
+ tzinfo (1.2.5)
44
45
  thread_safe (~> 0.1)
45
46
 
46
47
  PLATFORMS
@@ -48,13 +49,13 @@ PLATFORMS
48
49
 
49
50
  DEPENDENCIES
50
51
  database_cleaner (>= 1.2.0)
51
- globalize (~> 5.0)
52
+ globalize (~> 5.1)
52
53
  globalize-versioning!
53
54
  minitest
54
- paper_trail (= 4.0.0.beta2)
55
+ paper_trail (~> 10.0.1)
55
56
  rake
56
57
  rdoc
57
58
  sqlite3
58
59
 
59
60
  BUNDLED WITH
60
- 1.11.2
61
+ 1.16.2
@@ -2,6 +2,7 @@ require 'globalize'
2
2
 
3
3
  module Globalize::Versioning
4
4
  autoload :PaperTrail, 'globalize/versioning/paper_trail'
5
+ autoload :InstanceMethods, 'globalize/versioning/instance_methods'
5
6
  end
6
7
 
7
8
  Globalize::ActiveRecord::ActMacro.module_eval do
@@ -9,6 +10,7 @@ Globalize::ActiveRecord::ActMacro.module_eval do
9
10
  setup_translates_without_versioning!(options)
10
11
 
11
12
  if options[:versioning]
13
+ include Globalize::Versioning::InstanceMethods
12
14
 
13
15
  # hard-coded for now
14
16
  class_attribute :versioning_gem, :instance_accessor => false
@@ -23,5 +25,6 @@ Globalize::ActiveRecord::ActMacro.module_eval do
23
25
  end
24
26
  end
25
27
 
26
- alias_method_chain :setup_translates!, :versioning
28
+ alias_method :setup_translates_without_versioning!, :setup_translates!
29
+ alias_method :setup_translates!, :setup_translates_with_versioning!
27
30
  end
@@ -0,0 +1,9 @@
1
+ module Globalize
2
+ module Versioning
3
+ module InstanceMethods
4
+ def rollback
5
+ translation_caches[::Globalize.locale] = translation.paper_trail.previous_version
6
+ end
7
+ end
8
+ end
9
+ end
@@ -18,7 +18,8 @@ ActiveRecord::Base.class_eval do
18
18
  has_paper_trail_without_globalize(*args)
19
19
  include Globalize::Versioning::PaperTrail
20
20
  end
21
- alias_method_chain :has_paper_trail, :globalize
21
+ alias_method :has_paper_trail_without_globalize, :has_paper_trail
22
+ alias_method :has_paper_trail, :has_paper_trail_with_globalize
22
23
  end
23
24
  end
24
25
 
@@ -38,5 +39,6 @@ version_class.class_eval do
38
39
  def sibling_versions_with_locales
39
40
  sibling_versions_without_locales.for_this_locale
40
41
  end
41
- alias_method_chain :sibling_versions, :locales
42
+ alias_method :sibling_versions_without_locales, :sibling_versions
43
+ alias_method :sibling_versions, :sibling_versions_with_locales
42
44
  end
@@ -1,5 +1,5 @@
1
1
  module Globalize
2
2
  module Versioning
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: globalize-versioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Arndt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-28 00:00:00.000000000 Z
12
+ date: 2018-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -17,47 +17,47 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 3.2.0
20
+ version: 4.2.0
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '5'
23
+ version: '6'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: 3.2.0
30
+ version: 4.2.0
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '5'
33
+ version: '6'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: activemodel
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 3.2.0
40
+ version: 4.2.0
41
41
  - - "<"
42
42
  - !ruby/object:Gem::Version
43
- version: '5'
43
+ version: '6'
44
44
  type: :runtime
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
47
47
  requirements:
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
- version: 3.2.0
50
+ version: 4.2.0
51
51
  - - "<"
52
52
  - !ruby/object:Gem::Version
53
- version: '5'
53
+ version: '6'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: globalize
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 3.0.4
60
+ version: 5.1.0
61
61
  - - "<"
62
62
  - !ruby/object:Gem::Version
63
63
  version: '6'
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: 3.0.4
70
+ version: 5.1.0
71
71
  - - "<"
72
72
  - !ruby/object:Gem::Version
73
73
  version: '6'
@@ -77,20 +77,20 @@ dependencies:
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: 3.0.0
80
+ version: '8'
81
81
  - - "<"
82
82
  - !ruby/object:Gem::Version
83
- version: '5'
83
+ version: '12'
84
84
  type: :runtime
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
- version: 3.0.0
90
+ version: '8'
91
91
  - - "<"
92
92
  - !ruby/object:Gem::Version
93
- version: '5'
93
+ version: '12'
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: database_cleaner
96
96
  requirement: !ruby/object:Gem::Requirement
@@ -174,6 +174,7 @@ files:
174
174
  - Rakefile
175
175
  - lib/globalize-versioning.rb
176
176
  - lib/globalize/versioning.rb
177
+ - lib/globalize/versioning/instance_methods.rb
177
178
  - lib/globalize/versioning/paper_trail.rb
178
179
  - lib/globalize/versioning/version.rb
179
180
  homepage: http://github.com/globalize/globalize-versioning
@@ -196,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
197
  version: '0'
197
198
  requirements: []
198
199
  rubyforge_project: globalize-versioning
199
- rubygems_version: 2.5.1
200
+ rubygems_version: 2.7.6
200
201
  signing_key:
201
202
  specification_version: 4
202
203
  summary: Adapter for using versioning gems with Globalize