expose_association 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,15 +12,9 @@ module ExposeAssociation
12
12
  # allowing mass assignment of the has_one association
13
13
  self.attr_accessible exposer.association_attributes
14
14
  self.accepts_nested_attributes_for exposer.association_name
15
- self.send :alias_method, "old_#{exposer.association_name}", exposer.association_name
16
- self.send :alias_method, "old_#{exposer.association_name}=", "#{exposer.association_name}="
17
15
  self.class_eval <<-CODE
18
- def #{exposer.association_name}
19
- #{exposer.association_setup_method}
20
- end
21
-
22
16
  def #{exposer.association_setup_method}
23
- self.old_#{exposer.association_name} ||= #{exposer.association_class}.new
17
+ self.#{exposer.association_name} ||= #{exposer.association_class}.new
24
18
  end
25
19
  CODE
26
20
  end
@@ -1,3 +1,3 @@
1
1
  module ExposeAssociation
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -24,6 +24,7 @@ describe 'SomeModel with ExposeAssociation' do
24
24
  let(:contact) { Contact.new }
25
25
 
26
26
  it "should setup the association with the provided class" do
27
+ contact.setup_main_location
27
28
  contact.main_location.should be_a_kind_of(Address)
28
29
  end
29
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expose_association
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-12-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
16
- requirement: &70160113896320 !ruby/object:Gem::Requirement
16
+ requirement: &70365372290880 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70160113896320
24
+ version_requirements: *70365372290880
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70160113895020 !ruby/object:Gem::Requirement
27
+ requirement: &70365372289920 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70160113895020
35
+ version_requirements: *70365372289920
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sqlite3
38
- requirement: &70160113893880 !ruby/object:Gem::Requirement
38
+ requirement: &70365372289500 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70160113893880
46
+ version_requirements: *70365372289500
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: shoulda
49
- requirement: &70160113892360 !ruby/object:Gem::Requirement
49
+ requirement: &70365372288980 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70160113892360
57
+ version_requirements: *70365372288980
58
58
  description: ! "Easy exposition of has_one associations at the object\n level, to
59
59
  avoid nesting."
60
60
  email: