globalize 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +20 -11
- data/lib/globalize/active_record/act_macro.rb +5 -0
- data/lib/globalize/active_record/class_methods.rb +6 -4
- data/lib/globalize/active_record/{relation.rb → query_methods.rb} +1 -1
- data/lib/globalize/active_record.rb +1 -1
- data/lib/globalize/version.rb +1 -1
- metadata +19 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a1a82c5ec81f72d66b09459ad189182db93363f4
|
|
4
|
+
data.tar.gz: 9d335fdfa855cd4930c6e95d3800cf50ee96ee83
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 40d4c1ea4d89d551b1097a163bb15d9e582b07e52c939552bb8d5c8ad599ad74e929e78d6d7778d103fa5394e8ca30bc110bbcc2e218d00b77b4f0633967139c
|
|
7
|
+
data.tar.gz: b29d317a8a1eada6caec810ade6cde71a9451a8a6c0528f1da7e5a664d4be254d1c524b563872333b1c39d77f11858ced3166352d2ea2ae4ddba5262497f5764
|
data/Gemfile.lock
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
GIT
|
|
2
2
|
remote: git://github.com/airblade/paper_trail.git
|
|
3
|
-
revision:
|
|
3
|
+
revision: 7c9f9b8953f76dd046fbcbfab1a933853f99e87b
|
|
4
4
|
branch: master
|
|
5
5
|
specs:
|
|
6
|
-
paper_trail (3.0.0.
|
|
6
|
+
paper_trail (3.0.0.rc1)
|
|
7
7
|
activerecord (>= 3.0, < 5.0)
|
|
8
|
+
activesupport (>= 3.0, < 5.0)
|
|
8
9
|
|
|
9
10
|
GIT
|
|
10
11
|
remote: git://github.com/bmabey/database_cleaner.git
|
|
@@ -24,16 +25,16 @@ PATH
|
|
|
24
25
|
GEM
|
|
25
26
|
remote: https://rubygems.org/
|
|
26
27
|
specs:
|
|
27
|
-
activemodel (4.0.
|
|
28
|
-
activesupport (= 4.0.
|
|
28
|
+
activemodel (4.0.1)
|
|
29
|
+
activesupport (= 4.0.1)
|
|
29
30
|
builder (~> 3.1.0)
|
|
30
|
-
activerecord (4.0.
|
|
31
|
-
activemodel (= 4.0.
|
|
31
|
+
activerecord (4.0.1)
|
|
32
|
+
activemodel (= 4.0.1)
|
|
32
33
|
activerecord-deprecated_finders (~> 1.0.2)
|
|
33
|
-
activesupport (= 4.0.
|
|
34
|
+
activesupport (= 4.0.1)
|
|
34
35
|
arel (~> 4.0.0)
|
|
35
36
|
activerecord-deprecated_finders (1.0.3)
|
|
36
|
-
activesupport (4.0.
|
|
37
|
+
activesupport (4.0.1)
|
|
37
38
|
i18n (~> 0.6, >= 0.6.4)
|
|
38
39
|
minitest (~> 4.2)
|
|
39
40
|
multi_json (~> 1.3)
|
|
@@ -43,6 +44,13 @@ GEM
|
|
|
43
44
|
atomic (1.1.14)
|
|
44
45
|
builder (3.1.4)
|
|
45
46
|
coderay (1.0.9)
|
|
47
|
+
columnize (0.3.6)
|
|
48
|
+
debugger (1.6.1)
|
|
49
|
+
columnize (>= 0.3.1)
|
|
50
|
+
debugger-linecache (~> 1.2.0)
|
|
51
|
+
debugger-ruby_core_source (~> 1.2.3)
|
|
52
|
+
debugger-linecache (1.2.0)
|
|
53
|
+
debugger-ruby_core_source (1.2.3)
|
|
46
54
|
i18n (0.6.5)
|
|
47
55
|
json (1.8.1)
|
|
48
56
|
method_source (0.8.2)
|
|
@@ -54,10 +62,11 @@ GEM
|
|
|
54
62
|
coderay (~> 1.0.5)
|
|
55
63
|
method_source (~> 0.8)
|
|
56
64
|
slop (~> 3.4)
|
|
57
|
-
pry-
|
|
65
|
+
pry-debugger (0.2.2)
|
|
66
|
+
debugger (~> 1.3)
|
|
58
67
|
pry (~> 0.9.10)
|
|
59
68
|
rake (10.1.0)
|
|
60
|
-
rdoc (
|
|
69
|
+
rdoc (3.12.2)
|
|
61
70
|
json (~> 1.4)
|
|
62
71
|
slop (3.4.6)
|
|
63
72
|
sqlite3 (1.3.8)
|
|
@@ -75,7 +84,7 @@ DEPENDENCIES
|
|
|
75
84
|
minitest-colorize
|
|
76
85
|
paper_trail!
|
|
77
86
|
pry
|
|
78
|
-
pry-
|
|
87
|
+
pry-debugger
|
|
79
88
|
rake
|
|
80
89
|
rdoc
|
|
81
90
|
sqlite3
|
|
@@ -58,6 +58,11 @@ module Globalize
|
|
|
58
58
|
self.translation_options = options
|
|
59
59
|
self.fallbacks_for_empty_translations = options[:fallbacks_for_empty_translations]
|
|
60
60
|
|
|
61
|
+
# Alias original relation method so we can safely override it in ClassMethods.
|
|
62
|
+
class << self
|
|
63
|
+
alias relation_without_globalize relation
|
|
64
|
+
end
|
|
65
|
+
|
|
61
66
|
include InstanceMethods
|
|
62
67
|
extend ClassMethods, Migration
|
|
63
68
|
|
|
@@ -144,7 +144,7 @@ module Globalize
|
|
|
144
144
|
# of ActiveRecord::Relation with custom finder methods for translated
|
|
145
145
|
# attributes.
|
|
146
146
|
def relation
|
|
147
|
-
relation =
|
|
147
|
+
relation = globalize_relation_class.new(self, arel_table)
|
|
148
148
|
|
|
149
149
|
if finder_needs_type_condition?
|
|
150
150
|
relation.where(type_condition).create_with(inheritance_column.to_sym => sti_name)
|
|
@@ -153,9 +153,11 @@ module Globalize
|
|
|
153
153
|
end
|
|
154
154
|
end
|
|
155
155
|
|
|
156
|
-
# Use pattern defined in FriendlyId
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
# Use pattern defined in FriendlyId 4.x to avoid conflict with any other
|
|
157
|
+
# gems (such as FriendlyId) which override relation method.
|
|
158
|
+
def globalize_relation_class
|
|
159
|
+
@globalize_relation_class ||= Class.new(relation_without_globalize.class).tap do |klass|
|
|
160
|
+
klass.send :include, QueryMethods
|
|
159
161
|
const_set('GlobalizeActiveRecordRelation', klass)
|
|
160
162
|
end
|
|
161
163
|
end
|
|
@@ -8,6 +8,6 @@ module Globalize
|
|
|
8
8
|
autoload :InstanceMethods, 'globalize/active_record/instance_methods'
|
|
9
9
|
autoload :Migration, 'globalize/active_record/migration'
|
|
10
10
|
autoload :Translation, 'globalize/active_record/translation'
|
|
11
|
-
autoload :
|
|
11
|
+
autoload :QueryMethods, 'globalize/active_record/query_methods'
|
|
12
12
|
end
|
|
13
13
|
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.2
|
|
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: 2013-
|
|
17
|
+
date: 2013-12-07 00:00:00.000000000 Z
|
|
18
18
|
dependencies:
|
|
19
19
|
- !ruby/object:Gem::Dependency
|
|
20
20
|
name: activerecord
|
|
@@ -134,30 +134,30 @@ executables: []
|
|
|
134
134
|
extensions: []
|
|
135
135
|
extra_rdoc_files: []
|
|
136
136
|
files:
|
|
137
|
-
- lib/globalize
|
|
137
|
+
- lib/globalize.rb
|
|
138
|
+
- lib/patches/active_record/xml_attribute_serializer.rb
|
|
139
|
+
- lib/patches/active_record/uniqueness_validator.rb
|
|
140
|
+
- lib/patches/active_record/query_method.rb
|
|
141
|
+
- lib/globalize/active_record.rb
|
|
142
|
+
- lib/globalize/versioning/paper_trail.rb
|
|
138
143
|
- lib/globalize/active_record/adapter.rb
|
|
139
|
-
- lib/globalize/active_record/
|
|
140
|
-
- lib/globalize/active_record/class_methods.rb
|
|
141
|
-
- lib/globalize/active_record/exceptions.rb
|
|
142
|
-
- lib/globalize/active_record/instance_methods.rb
|
|
144
|
+
- lib/globalize/active_record/query_methods.rb
|
|
143
145
|
- lib/globalize/active_record/migration.rb
|
|
144
|
-
- lib/globalize/active_record/
|
|
146
|
+
- lib/globalize/active_record/act_macro.rb
|
|
145
147
|
- lib/globalize/active_record/translation.rb
|
|
146
|
-
- lib/globalize/active_record.rb
|
|
147
|
-
- lib/globalize/
|
|
148
|
-
- lib/globalize/
|
|
149
|
-
- lib/globalize/
|
|
148
|
+
- lib/globalize/active_record/instance_methods.rb
|
|
149
|
+
- lib/globalize/active_record/class_methods.rb
|
|
150
|
+
- lib/globalize/active_record/exceptions.rb
|
|
151
|
+
- lib/globalize/active_record/attributes.rb
|
|
150
152
|
- lib/globalize/versioning.rb
|
|
151
|
-
- lib/globalize.rb
|
|
152
|
-
- lib/
|
|
153
|
+
- lib/globalize/version.rb
|
|
154
|
+
- lib/globalize/interpolation.rb
|
|
153
155
|
- lib/i18n/missing_translations_raise_handler.rb
|
|
154
|
-
- lib/
|
|
155
|
-
-
|
|
156
|
-
-
|
|
156
|
+
- lib/i18n/missing_translations_log_handler.rb
|
|
157
|
+
- Rakefile
|
|
158
|
+
- LICENSE
|
|
157
159
|
- Gemfile
|
|
158
160
|
- Gemfile.lock
|
|
159
|
-
- LICENSE
|
|
160
|
-
- Rakefile
|
|
161
161
|
homepage: https://github.com/globalize/globalize
|
|
162
162
|
licenses:
|
|
163
163
|
- MIT
|