denormalize_mm 0.2.2 → 0.2.3
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 +15 -0
- data/lib/mongo_mapper/denormalization.rb +10 -6
- metadata +5 -7
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OWNlOGQ0ZWVjNTM3ZmIxY2MyNTkxMjI2MzFkZWI3N2ZjZjEyMTBiMA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
OTFlNjQxZWQ0MmJiYTY4YTUwOGVlYmY3ZjQzYjRiOThmZGE0YzY5Zg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NjFmYjVmYWJiZTc0ZWU0YzIxMTE4NDRhM2E5MjE3YmYzYThiMmYzZGU0MzBi
|
10
|
+
YmQ5ZTgzNDE5YTk4ODMzNjI2ZDg2MjY2MGQ5ZjQyN2NiZmRlYzBkMzc3MWFm
|
11
|
+
NjNiMzAyYjM4Zjc2Y2NjNDRiZWYxNDlkMzQ2NjZkNzIwZTZmNTg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OGQ5NTQ4OWVkYTRjYzIzZGU5YjhlMDBhNjIzODFjMmU0ZDExYTNhYmZjZjJl
|
14
|
+
Mzk1YmExYjIyOGJkZjYxYzg2MzFlODZiMGUwMjA2NWVlNTE2YjQ3NmE2NzQx
|
15
|
+
M2RiNzkzMjNiYjdlZWUzZDFiYzY5MjFlYmUyZDIxMDc2NzI1OGY=
|
@@ -10,20 +10,24 @@ module MongoMapper::Denormalization
|
|
10
10
|
denormalize(association, field, options)
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
14
|
-
options =
|
13
|
+
def denormalize_associations(*destinations)
|
14
|
+
options = destinations.last.is_a?(Hash) ? destinations.pop.dup : {}
|
15
15
|
source = options.delete(:from)
|
16
16
|
|
17
17
|
if !source
|
18
18
|
raise "denormalize_association must take a from (source) option"
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
destinations.each do |dest|
|
22
|
+
denormalize(source, dest, {
|
23
|
+
:target_field => dest,
|
24
|
+
:is_association => true
|
25
|
+
}.merge(options))
|
26
|
+
end
|
25
27
|
end
|
26
28
|
|
29
|
+
alias_method :denormalize_association, :denormalize_associations
|
30
|
+
|
27
31
|
def denormalize(association, field, options={})
|
28
32
|
association = association.to_sym
|
29
33
|
field = field.to_sym
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: denormalize_mm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Scott Taylor
|
@@ -10,7 +9,7 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2014-
|
12
|
+
date: 2014-11-20 00:00:00.000000000 Z
|
14
13
|
dependencies: []
|
15
14
|
description: Helpers to denormalize fields easily on mongo mapper models
|
16
15
|
email: scott@railsnewbie.com
|
@@ -22,26 +21,25 @@ files:
|
|
22
21
|
homepage: http://github.com/GoLearnUp/denormalize_mm
|
23
22
|
licenses:
|
24
23
|
- MIT
|
24
|
+
metadata: {}
|
25
25
|
post_install_message:
|
26
26
|
rdoc_options: []
|
27
27
|
require_paths:
|
28
28
|
- lib
|
29
29
|
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
-
none: false
|
31
30
|
requirements:
|
32
31
|
- - ! '>='
|
33
32
|
- !ruby/object:Gem::Version
|
34
33
|
version: '0'
|
35
34
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
-
none: false
|
37
35
|
requirements:
|
38
36
|
- - ! '>='
|
39
37
|
- !ruby/object:Gem::Version
|
40
38
|
version: '0'
|
41
39
|
requirements: []
|
42
40
|
rubyforge_project:
|
43
|
-
rubygems_version:
|
41
|
+
rubygems_version: 2.4.2
|
44
42
|
signing_key:
|
45
|
-
specification_version:
|
43
|
+
specification_version: 4
|
46
44
|
summary: Denormalize fields easily in mongo mapper
|
47
45
|
test_files: []
|