linker 0.0.7 → 0.0.8

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: 6a85767c89d82ddee71e500f12a6c7d3f0291390
4
- data.tar.gz: 18733c09f9ea3ab6cd2aee4ec9611940a0f11020
3
+ metadata.gz: 4afc91d2a7459a04762858aee718f4796ed5d376
4
+ data.tar.gz: e3b823338893dfba0d269c6145e5630f6b6ada0c
5
5
  SHA512:
6
- metadata.gz: a4ae6437a712fa0b84a1bbfa7fee8a5896a4035cf99c332e71bbf820773cc3e2457a5926f7235eaa3e1c3ae3c3a805a34872b9fa28f9597756ef50527bd2417b
7
- data.tar.gz: ec68dd806f30c3e5c20296e0e1bc413550650f640e671ac6e5a3bde612ff7e3fb1ef9420a7a77ccf4c8c51e6135d8b957381b46421cb262b7b55f11d31186dc1
6
+ metadata.gz: 80d30f36e9d61fb57d7dc891dd91cb1e2708a2b1dce23dfce22db0d583eec37be216106769922bb47f733849514d4e00d2313bb77e94d9cd035292a45b435eb2
7
+ data.tar.gz: 825251632a2d80566da887e19dae7d4ad59722416adfbd1f97ff43882e5fbc705a69a52755f4d87cabf46746d11b6dc588a6e15bfe602f44185b4506d82541dd
@@ -31,6 +31,13 @@ module Linker
31
31
  def set_delegations
32
32
  # Delegate fields for main model
33
33
  filter_columns(@main_model).each{|c| delegate_attr(c, @main_model.to_s.underscore) }
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]}_")
39
+ end
40
+ end
34
41
  end
35
42
 
36
43
  private
@@ -1,3 +1,3 @@
1
1
  module Linker
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -35,6 +35,12 @@ describe UsersForm do
35
35
  it { expect(tasks_sample).to respond_to(:_remove) }
36
36
 
37
37
  it { expect(users_form).to respond_to(:address, :address_attributes=) }
38
+ it { expect(users_form).to respond_to(:address__street, :address__street=) }
39
+ it { expect(users_form).to respond_to(:address__district, :address__district=) }
40
+ it { expect(users_form).to respond_to(:address__user_id, :address__user_id=) }
41
+ it { expect(users_form.address__street).to eq(nil) }
42
+ it { expect(users_form.address__district).to eq(nil) }
43
+ it { expect(users_form.address__user_id).to eq(nil) }
38
44
  subject(:address) { users_form.address }
39
45
  it { expect(address).to be_an(Address) }
40
46
 
@@ -47,6 +53,10 @@ describe UsersForm do
47
53
  it { expect(my_phone_list).to eq(nil) }
48
54
 
49
55
  it { expect(users_form).to respond_to(:little_pet, :little_pet_attributes=) }
56
+ it { expect(users_form).to respond_to(:little_pet__name, :little_pet__name=) }
57
+ it { expect(users_form).to respond_to(:little_pet__user_id, :little_pet__user_id=) }
58
+ it { expect(users_form.little_pet__name).to eq(nil) }
59
+ it { expect(users_form.little_pet__user_id).to eq(nil) }
50
60
  subject(:pet) { users_form.little_pet }
51
61
  it { expect(pet).to be_an(Pet) }
52
62
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glauco Custódio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-11 00:00:00.000000000 Z
11
+ date: 2014-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport