build_associated 1.0.1 → 1.1.1
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.
- data/lib/build_associated.rb +1 -1
- data/lib/build_associated/version.rb +1 -1
- metadata +4 -4
data/lib/build_associated.rb
CHANGED
@@ -6,7 +6,7 @@ module BuildAssociated
|
|
6
6
|
module ClassMethods
|
7
7
|
def build_associated association_name
|
8
8
|
alias_method "_#{association_name}", association_name
|
9
|
-
remove_method association_name
|
9
|
+
remove_method(association_name) if method_defined?(association_name)
|
10
10
|
|
11
11
|
define_method association_name do
|
12
12
|
obj = self.send("_#{association_name}")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build_associated
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-01-23 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
16
|
-
requirement: &
|
16
|
+
requirement: &19687120 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *19687120
|
25
25
|
description: Have ActiveRecord automagically build an association when accessed. Useful
|
26
26
|
for belongs_to associations which should never be nil.
|
27
27
|
email:
|