linker 0.0.8 → 0.0.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4afc91d2a7459a04762858aee718f4796ed5d376
4
- data.tar.gz: e3b823338893dfba0d269c6145e5630f6b6ada0c
3
+ metadata.gz: 649af5b02f108cc0845bce6e6ff29976782fd752
4
+ data.tar.gz: 6b03c70603069decf64f7851a809bb097449d156
5
5
  SHA512:
6
- metadata.gz: 80d30f36e9d61fb57d7dc891dd91cb1e2708a2b1dce23dfce22db0d583eec37be216106769922bb47f733849514d4e00d2313bb77e94d9cd035292a45b435eb2
7
- data.tar.gz: 825251632a2d80566da887e19dae7d4ad59722416adfbd1f97ff43882e5fbc705a69a52755f4d87cabf46746d11b6dc588a6e15bfe602f44185b4506d82541dd
6
+ metadata.gz: b3eea6edd014d9d59032168f360618631e708afc5555db3d5f8470fad5c0417f7f3a306bd745441e93582f23267232ed950cc6fbdf20e0770e9be3ac66cc47d1
7
+ data.tar.gz: 6cc4e1c49383406fa85f180fb84ce74b05fa36b8b251302509888a04949deae9b0f950df6a9b5778487b241900074ce276bdd3290bb605030caf0589cc29f5dd
@@ -32,10 +32,12 @@ module Linker
32
32
  # Delegate fields for main model
33
33
  filter_columns(@main_model).each{|c| delegate_attr(c, @main_model.to_s.underscore) }
34
34
 
35
- map_has_one_associations.each do |c|
36
- c[:columns].each do |cc|
37
- #ap "delegando #{cc} e #{cc}= para #{c[:name]}__#{cc}"
38
- self.class.__send__(:delegate, cc, "#{cc}=", to: c[:name].underscore.to_sym, prefix: "#{c[:name]}_")
35
+ [map_has_one_associations, map_belongs_to_associations].each do |rgroup|
36
+ rgroup.each do |c|
37
+ c[:columns].each do |cc|
38
+ #ap "delegando #{cc} e #{cc}= para #{c[:name]}__#{cc}"
39
+ self.class.__send__(:delegate, cc, "#{cc}=", to: c[:name].underscore.to_sym, prefix: "#{c[:name]}_")
40
+ end
39
41
  end
40
42
  end
41
43
  end
@@ -1,3 +1,3 @@
1
1
  module Linker
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -61,10 +61,16 @@ describe UsersForm do
61
61
  it { expect(pet).to be_an(Pet) }
62
62
 
63
63
  it { expect(users_form).to respond_to(:company, :company_attributes=) }
64
+ it { expect(users_form).to respond_to(:company__name, :company__name=) }
65
+ it { expect(users_form).to respond_to(:company__website, :company__website=) }
66
+ it { expect(users_form.company__name).to eq(nil) }
67
+ it { expect(users_form.company__website).to eq(nil) }
64
68
  subject(:company) { users_form.company }
65
69
  it { expect(company).to be_an(Company) }
66
70
 
67
71
  it { expect(users_form).to respond_to(:my_family, :my_family_attributes=) }
72
+ it { expect(users_form).to respond_to(:my_family__last_name, :my_family__last_name=) }
73
+ it { expect(users_form.my_family__last_name).to eq(nil) }
68
74
  subject(:family) { users_form.my_family }
69
75
  it { expect(family).to be_an(Family) }
70
76
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glauco Custódio