activerecord-denormalize 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Appraisals +7 -0
- data/README.md +6 -0
- data/Rakefile +8 -1
- data/activerecord-denormalize.gemspec +2 -0
- data/gemfiles/activerecord_3.2.gemfile +7 -0
- data/gemfiles/activerecord_4.0.gemfile +7 -0
- data/lib/active_record/denormalize.rb +9 -3
- data/lib/activerecord-denormalize/version.rb +1 -1
- metadata +45 -21
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1caec859e66406b70fcf5873148df359e01f2d41
|
4
|
+
data.tar.gz: 1ff079a68a593a90cf732b9c0a07760293a9c7b0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6fef90d77a312c931abb7802083e2bbd9cca33b7edad1bec876796bf97c48a8658423766551da72c0c38c76fdd0ceb9bc16d86220186ed991f632454a42f08a2
|
7
|
+
data.tar.gz: b393812ec69fdb42bd3fa9d3aab8e357a734909fd9c33721c93eff232c8873fcb00df488e9cd87e48d4be3fb6e9c9f7c28d988473244691ccc8680e7542638bf
|
data/.gitignore
CHANGED
data/Appraisals
ADDED
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
require 'activerecord-postgres-hstore'
|
1
|
+
require 'activerecord-postgres-hstore/coder'
|
2
2
|
|
3
3
|
module ActiveRecord::Denormalize
|
4
4
|
class << self
|
5
5
|
def included(builder)
|
6
|
-
|
6
|
+
# Support for ActiveRecord 3.2
|
7
|
+
builder.valid_options << :denormalize if builder.valid_options
|
7
8
|
end
|
8
9
|
|
9
10
|
def extract_attributes(obj, keys)
|
@@ -28,6 +29,11 @@ module ActiveRecord::Denormalize
|
|
28
29
|
}
|
29
30
|
end
|
30
31
|
|
32
|
+
# Support for ActiveRecord 4
|
33
|
+
def valid_options
|
34
|
+
super + [:denormalize]
|
35
|
+
end
|
36
|
+
|
31
37
|
private
|
32
38
|
|
33
39
|
def configure_denormalize(reflection)
|
@@ -52,7 +58,7 @@ module ActiveRecord::Denormalize
|
|
52
58
|
mixin.redefine_method method_name do
|
53
59
|
attrs = ActiveRecord::Denormalize.extract_attributes(self, attributes)
|
54
60
|
|
55
|
-
__send__(dest_name).update_all ["#{store_in} = ?::hstore", attrs
|
61
|
+
__send__(dest_name).update_all ["#{store_in} = ?::hstore", ActiveRecord::Coders::Hstore.dump(attrs)]
|
56
62
|
end
|
57
63
|
|
58
64
|
model.after_save method_name
|
metadata
CHANGED
@@ -1,62 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-denormalize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Keita Urashima
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-04-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activerecord
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: activerecord-postgres-hstore
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: appraisal
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pg
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
44
67
|
- !ruby/object:Gem::Version
|
45
68
|
version: '0'
|
46
69
|
- !ruby/object:Gem::Dependency
|
47
70
|
name: rspec
|
48
71
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
72
|
requirements:
|
51
|
-
- -
|
73
|
+
- - '>='
|
52
74
|
- !ruby/object:Gem::Version
|
53
75
|
version: '0'
|
54
76
|
type: :development
|
55
77
|
prerelease: false
|
56
78
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
79
|
requirements:
|
59
|
-
- -
|
80
|
+
- - '>='
|
60
81
|
- !ruby/object:Gem::Version
|
61
82
|
version: '0'
|
62
83
|
description: Denormalize fields in ActiveRecord.
|
@@ -67,11 +88,14 @@ extensions: []
|
|
67
88
|
extra_rdoc_files: []
|
68
89
|
files:
|
69
90
|
- .gitignore
|
91
|
+
- Appraisals
|
70
92
|
- Gemfile
|
71
93
|
- LICENSE.txt
|
72
94
|
- README.md
|
73
95
|
- Rakefile
|
74
96
|
- activerecord-denormalize.gemspec
|
97
|
+
- gemfiles/activerecord_3.2.gemfile
|
98
|
+
- gemfiles/activerecord_4.0.gemfile
|
75
99
|
- lib/active_record/denormalize.rb
|
76
100
|
- lib/activerecord-denormalize.rb
|
77
101
|
- lib/activerecord-denormalize/version.rb
|
@@ -79,28 +103,28 @@ files:
|
|
79
103
|
- spec/spec_helper.rb
|
80
104
|
homepage: ''
|
81
105
|
licenses: []
|
106
|
+
metadata: {}
|
82
107
|
post_install_message:
|
83
108
|
rdoc_options: []
|
84
109
|
require_paths:
|
85
110
|
- lib
|
86
111
|
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
-
none: false
|
88
112
|
requirements:
|
89
|
-
- -
|
113
|
+
- - '>='
|
90
114
|
- !ruby/object:Gem::Version
|
91
115
|
version: '0'
|
92
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
-
none: false
|
94
117
|
requirements:
|
95
|
-
- -
|
118
|
+
- - '>='
|
96
119
|
- !ruby/object:Gem::Version
|
97
120
|
version: '0'
|
98
121
|
requirements: []
|
99
122
|
rubyforge_project:
|
100
|
-
rubygems_version:
|
123
|
+
rubygems_version: 2.0.0
|
101
124
|
signing_key:
|
102
|
-
specification_version:
|
125
|
+
specification_version: 4
|
103
126
|
summary: ''
|
104
127
|
test_files:
|
105
128
|
- spec/active_record/denormalize_spec.rb
|
106
129
|
- spec/spec_helper.rb
|
130
|
+
has_rdoc:
|