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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55c8f939e00d88a8e04e455fc167cc48c9554899
4
- data.tar.gz: f35d2be7abd236669c2762ade7824df8893b03b6
3
+ metadata.gz: a8d6018990f0bca11ec45bf5d679f0843767e34b
4
+ data.tar.gz: ef8f54f4de9e9ec11ce9d86cebecd6827d5b8a9b
5
5
  SHA512:
6
- metadata.gz: 788c54a7ff87d649d6dd3915c00431b66fe1dea43b243afc4fd789b92702990f0ea410afa66bf2869728a715239df157b510451047dce4d1f338a8f99f00e226
7
- data.tar.gz: b2408877c82375762870110e126d5f607335dcb9bf5c614efffb70d208f6caa9a6df98ad84bc20e74a8503dbfccffdd6d87a038961712135531a65802bb73d0c
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.2"
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
- if ass.collection?
23
- delegate "#{ass.name}", to: association, allow_nil: options[:allow_nil]
24
- delegate "#{ass.name}=", to: association, allow_nil: options[:allow_nil]
25
- else
26
- delegate "#{ass.name}", to: association
27
- delegate "#{ass.name}=", to: association
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.2
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 00:00:00.000000000 Z
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: