delegate_associations 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/delegate_associations.gemspec +1 -1
- data/lib/delegate_associations.rb +9 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8d6018990f0bca11ec45bf5d679f0843767e34b
|
4
|
+
data.tar.gz: ef8f54f4de9e9ec11ce9d86cebecd6827d5b8a9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f185c261032f99f6b2b5a82208bc62e12e72fed5b4b370ba9975e56f74f385ec1ea71b109ff2618019b4916a7c2ebc192ec45e64ce737f685468aecd4be562d2
|
7
|
+
data.tar.gz: 01b0b7e4606a7255d01eebd03e5010be93cbb04dbce27e274254fa750478089d514957d3a48b2ffbe3f9e91b62cea12cfbf135211775523c4af68cd2a7c1773e
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "delegate_associations"
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.3"
|
4
4
|
s.description = "A gem for delegate attributes and associations of belongs_to and has_one"
|
5
5
|
s.summary = "A gem for delegate attributes and associations of belongs_to and has_one"
|
6
6
|
s.homepage = "https://github.com/Brunomm/delegate_associations"
|
@@ -19,12 +19,15 @@ module DelegateAssociations
|
|
19
19
|
associations.each do |association|
|
20
20
|
reflect_on_association(association).klass.reflect_on_all_associations.each do |ass|
|
21
21
|
next unless ass.name.in?(get_deletage_methods(reflect_on_association(association).klass.reflect_on_all_associations.map(&:name), except, only))
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
delegate "#{ass.name}", to: association, allow_nil: options[:allow_nil]
|
23
|
+
delegate "#{ass.name}=", to: association, allow_nil: options[:allow_nil]
|
24
|
+
begin
|
25
|
+
delegate "#{ass.name}_attributes=", to: association, allow_nil: options[:allow_nil]
|
26
|
+
rescue
|
27
|
+
true
|
28
|
+
end
|
29
|
+
|
30
|
+
unless ass.collection?
|
28
31
|
delegate "build_#{ass.name}", to: association
|
29
32
|
end
|
30
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delegate_associations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Mucelini Mergen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A gem for delegate attributes and associations of belongs_to and has_one
|
14
14
|
email:
|