globalize 4.0.0.alpha.4 → 4.0.0.alpha.5

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: 346bd7c5bd2e5a5f967a664e31cd11daee6d19c8
4
- data.tar.gz: 51953b552d2ba5f9e87f6c710767ac498b19db47
3
+ metadata.gz: 1bce2b8d2ba3ab466f5c8bac81562482d472952b
4
+ data.tar.gz: 23400f0484f4c5227dcef16dd832c39f3940a000
5
5
  SHA512:
6
- metadata.gz: 4204e5c710147a377f5ae008a5df25d7611c3366555581daa8d4ccf51d82b38ba4e387fc7a81db7530dccba1874ef951ac4490915501c1cc8227fcbe73802675
7
- data.tar.gz: 4705b6326dba707413cbff15ff3d0799a3a53b17154c7874725cd98c878023e05657f42cd94567925b8f9433884f3c7b85f80bb89f39571402c5894ede1d0f74
6
+ metadata.gz: 41e2197fa628ff13cb26cf77a79cb0dd075727bdb05478fac387eed20e24443e6b4c11ee50c4ae1659ff3cc4f78a14525b271763b578df77665bcd8463e6904f
7
+ data.tar.gz: a4267002cbd0833bbbae6b95632d21026f7a0d44f5adb1ad4d4a4f2c8cd9d44369e21d6e93f7de99060e95c988bf0a9fade6aa560f650b91f05a47b3093014c4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Globalize Changelog
2
2
 
3
+ ## 4.0.0.alpha.5 (2014-1-4)
4
+ * Fix issue where globalize breaks has_many through when model called with `where` (thanks [Paul McMahon](https://github.com/pwim)).
5
+ * Modify dup so that translations are copied, and remove custom clone code to conform to Rails/AR semantics (thanks [Paul McMahon](https://github.com/pwim)).
6
+
3
7
  ## 4.0.0.alpha.4 (2013-12-30)
4
8
  * Add this changelog.
5
9
  * Add contributing guidelines.
data/Gemfile.lock CHANGED
@@ -1,6 +1,6 @@
1
1
  GIT
2
2
  remote: git://github.com/airblade/paper_trail.git
3
- revision: c4e188c27040888515866660bac94740b92a262b
3
+ revision: 25c349588b1107c1bb77ffcfb5a98e5227044507
4
4
  branch: master
5
5
  specs:
6
6
  paper_trail (3.0.0)
@@ -9,7 +9,7 @@ GIT
9
9
 
10
10
  GIT
11
11
  remote: git://github.com/bmabey/database_cleaner.git
12
- revision: c0c7885466287dcde3dbac195a5f10df306db098
12
+ revision: 072492166e82969136d1abaeccbcadaae4fe6539
13
13
  branch: master
14
14
  specs:
15
15
  database_cleaner (1.2.0)
@@ -17,7 +17,7 @@ GIT
17
17
  PATH
18
18
  remote: .
19
19
  specs:
20
- globalize (4.0.0.alpha.3)
20
+ globalize (4.0.0.alpha.5)
21
21
  activemodel (>= 4.0.0)
22
22
  activerecord (>= 4.0.0)
23
23
  paper_trail (~> 3.0.0.beta)
@@ -66,8 +66,8 @@ GEM
66
66
  slop (~> 3.4)
67
67
  pry-nav (0.2.3)
68
68
  pry (~> 0.9.10)
69
- rake (10.1.0)
70
- rdoc (4.0.1)
69
+ rake (10.1.1)
70
+ rdoc (4.1.0)
71
71
  json (~> 1.4)
72
72
  rubysl (2.0.15)
73
73
  rubysl-abbrev (~> 2.0)
@@ -173,7 +173,7 @@ GEM
173
173
  rubysl-coverage (2.0.3)
174
174
  rubysl-csv (2.0.2)
175
175
  rubysl-english (~> 2.0)
176
- rubysl-curses (2.0.0)
176
+ rubysl-curses (2.0.1)
177
177
  rubysl-date (2.0.6)
178
178
  rubysl-delegate (2.0.1)
179
179
  rubysl-digest (2.0.3)
@@ -98,17 +98,11 @@ module Globalize
98
98
  super(options)
99
99
  end
100
100
 
101
- def clone
102
- obj = super
103
- return obj unless respond_to?(:translated_attribute_names)
104
-
105
- obj.instance_variable_set(:@translations, nil) if new_record? # Reset the collection because of rails bug: http://pastie.org/1521874
106
- obj.instance_variable_set(:@globalize, nil )
107
- each_locale_and_translated_attribute do |locale, name|
108
- obj.globalize.write(locale, name, globalize.fetch(locale, name) )
101
+ def initialize_dup(other)
102
+ super
103
+ other.each_locale_and_translated_attribute do |locale, name|
104
+ globalize.write(locale, name, other.globalize.fetch(locale, name) )
109
105
  end
110
-
111
- return obj
112
106
  end
113
107
 
114
108
  def translation
@@ -52,7 +52,7 @@ module Globalize
52
52
  end
53
53
 
54
54
  def parse_translated_conditions(opts)
55
- if opts.is_a?(Hash) && (keys = opts.symbolize_keys.keys & translated_attribute_names).present?
55
+ if opts.is_a?(Hash) && respond_to?(:translated_attribute_names) && (keys = opts.symbolize_keys.keys & translated_attribute_names).present?
56
56
  opts = opts.dup
57
57
  keys.each { |key| opts[translated_column_name(key)] = opts.delete(key) || opts.delete(key.to_s) }
58
58
  opts
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.0.0.alpha.4
4
+ version: 4.0.0.alpha.5
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-12-30 00:00:00.000000000 Z
17
+ date: 2014-01-04 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord