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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b12c925d8338f75e9dfa650c3f12b1305bd6ccfb
4
- data.tar.gz: d538a66932ea892300d07134c3198ae7a99a731f
3
+ metadata.gz: a1a82c5ec81f72d66b09459ad189182db93363f4
4
+ data.tar.gz: 9d335fdfa855cd4930c6e95d3800cf50ee96ee83
5
5
  SHA512:
6
- metadata.gz: b3317c480503cc55735336c7d6ac01dcc9e9dc46db171e3f4d8c71da6a6cdb6e2b7323474b5eee5a85c76e1787816308156caf0ff0a812a27d7f66412bf99d19
7
- data.tar.gz: 195bddff49e9d4905893697a705e25f9b65d4b1c8eaee548a89a2faa7e168e5e025446bf9d674d16a72477a18367cab65e955d77d54b8b0cc37bcdda0ac14b8b
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: 44f2380ec6cd45c15a8b654d5e7d694499c6e11c
3
+ revision: 7c9f9b8953f76dd046fbcbfab1a933853f99e87b
4
4
  branch: master
5
5
  specs:
6
- paper_trail (3.0.0.beta2)
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.0)
28
- activesupport (= 4.0.0)
28
+ activemodel (4.0.1)
29
+ activesupport (= 4.0.1)
29
30
  builder (~> 3.1.0)
30
- activerecord (4.0.0)
31
- activemodel (= 4.0.0)
31
+ activerecord (4.0.1)
32
+ activemodel (= 4.0.1)
32
33
  activerecord-deprecated_finders (~> 1.0.2)
33
- activesupport (= 4.0.0)
34
+ activesupport (= 4.0.1)
34
35
  arel (~> 4.0.0)
35
36
  activerecord-deprecated_finders (1.0.3)
36
- activesupport (4.0.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-nav (0.2.3)
65
+ pry-debugger (0.2.2)
66
+ debugger (~> 1.3)
58
67
  pry (~> 0.9.10)
59
68
  rake (10.1.0)
60
- rdoc (4.0.1)
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-nav
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 = relation_class.new(self, arel_table)
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 (4.x) to avoid conflict.
157
- def relation_class
158
- @relation_class ||= Class.new(Relation).tap do |klass|
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
@@ -1,6 +1,6 @@
1
1
  module Globalize
2
2
  module ActiveRecord
3
- class Relation < ::ActiveRecord::Relation
3
+ module QueryMethods
4
4
 
5
5
  if ::ActiveRecord::VERSION::STRING >= "3.2.1"
6
6
  def where_values_hash
@@ -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 :Relation, 'globalize/active_record/relation'
11
+ autoload :QueryMethods, 'globalize/active_record/query_methods'
12
12
  end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module Globalize
2
- Version = '3.0.1'
2
+ Version = '3.0.2'
3
3
  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: 3.0.1
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-11-07 00:00:00.000000000 Z
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/active_record/act_macro.rb
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/attributes.rb
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/relation.rb
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/interpolation.rb
148
- - lib/globalize/version.rb
149
- - lib/globalize/versioning/paper_trail.rb
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/i18n/missing_translations_log_handler.rb
153
+ - lib/globalize/version.rb
154
+ - lib/globalize/interpolation.rb
153
155
  - lib/i18n/missing_translations_raise_handler.rb
154
- - lib/patches/active_record/query_method.rb
155
- - lib/patches/active_record/uniqueness_validator.rb
156
- - lib/patches/active_record/xml_attribute_serializer.rb
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