l10n 0.0.4 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/l10n.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'i18n'
2
2
  require 'action_view'
3
3
  require 'action_dispatch'
4
- require 'active_support'
4
+ require 'active_support/all'
5
5
 
6
6
  require 'l10n/version'
7
7
  require 'l10n/core_extensions'
@@ -1,5 +1,4 @@
1
1
  require 'bigdecimal'
2
- require 'active_support'
3
2
 
4
3
  module L10n
5
4
  module CoreExtensions
@@ -3,16 +3,18 @@ require 'active_record'
3
3
  module L10n
4
4
  module NumericColumnConversions
5
5
 
6
- def self.included(base)
7
- base.alias_method_chain :convert_number_column_value, :l10n
6
+ private
7
+
8
+ def write_attribute(attr_name, value)
9
+ column = column_for_attribute(attr_name.to_s)
10
+ if column && column.number? && value.is_a?(String)
11
+ value = Numeric.delocalize(value)
12
+ end
13
+ super(attr_name, value)
8
14
  end
9
-
10
- def convert_number_column_value_with_l10n(value)
11
- Numeric.delocalize(convert_number_column_value_without_l10n(value))
12
- end
13
-
15
+
14
16
  end
15
-
17
+
16
18
  end
17
19
 
18
20
  ActiveRecord::Base.class_eval { include L10n::NumericColumnConversions }
data/lib/l10n/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module L10n
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: l10n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-11 00:00:00.000000000 Z
12
+ date: 2013-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
16
- requirement: &2151917000 !ruby/object:Gem::Requirement
16
+ requirement: &2151926940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0.5'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2151917000
24
+ version_requirements: *2151926940
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activerecord
27
- requirement: &2151916280 !ruby/object:Gem::Requirement
27
+ requirement: &2151926040 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2151916280
35
+ version_requirements: *2151926040
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activesupport
38
- requirement: &2151915440 !ruby/object:Gem::Requirement
38
+ requirement: &2151925500 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 3.0.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2151915440
46
+ version_requirements: *2151925500
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: actionpack
49
- requirement: &2151914740 !ruby/object:Gem::Requirement
49
+ requirement: &2151924840 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 3.0.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2151914740
57
+ version_requirements: *2151924840
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: sqlite3
60
- requirement: &2151914220 !ruby/object:Gem::Requirement
60
+ requirement: &2151924340 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,21 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2151914220
68
+ version_requirements: *2151924340
69
+ - !ruby/object:Gem::Dependency
70
+ name: debugger
71
+ requirement: &2151923520 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *2151923520
69
80
  - !ruby/object:Gem::Dependency
70
81
  name: simplecov
71
- requirement: &2151913500 !ruby/object:Gem::Requirement
82
+ requirement: &2151922880 !ruby/object:Gem::Requirement
72
83
  none: false
73
84
  requirements:
74
85
  - - ! '>='
@@ -76,10 +87,10 @@ dependencies:
76
87
  version: '0'
77
88
  type: :development
78
89
  prerelease: false
79
- version_requirements: *2151913500
90
+ version_requirements: *2151922880
80
91
  - !ruby/object:Gem::Dependency
81
92
  name: rake
82
- requirement: &2151912880 !ruby/object:Gem::Requirement
93
+ requirement: &2151922100 !ruby/object:Gem::Requirement
83
94
  none: false
84
95
  requirements:
85
96
  - - ! '>='
@@ -87,7 +98,7 @@ dependencies:
87
98
  version: 0.8.7
88
99
  type: :development
89
100
  prerelease: false
90
- version_requirements: *2151912880
101
+ version_requirements: *2151922100
91
102
  description: I18n that roarrrs
92
103
  email: mtgrosser@gmx.net
93
104
  executables: []