anaf_habtm 0.0.81 → 0.0.82
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/Rakefile +1 -1
- data/anaf_habtm.gemspec +2 -2
- data/lib/anaf_active_record.rb +3 -3
- metadata +4 -4
data/Rakefile
CHANGED
data/anaf_habtm.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{anaf_habtm}
|
|
8
|
-
s.version = "0.0.
|
|
8
|
+
s.version = "0.0.82"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Tyler Gannon"]
|
|
12
|
-
s.date = %q{2010-07-
|
|
12
|
+
s.date = %q{2010-07-11}
|
|
13
13
|
s.description = %q{accepts_nested_attributes_for habtm}
|
|
14
14
|
s.email = %q{t--g__a--nnon@gmail.com}
|
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/anaf_active_record.rb
CHANGED
|
@@ -26,11 +26,11 @@ module AnafHabtm
|
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def named_association(member,
|
|
29
|
+
def named_association(member, attribute, opts={})
|
|
30
30
|
member = member.to_s
|
|
31
|
-
klass =
|
|
31
|
+
klass = opts.has_key?(:class) ? opts[:class_name] : member.to_s.singularize.camelize
|
|
32
32
|
attribute = attribute.to_s
|
|
33
|
-
if create
|
|
33
|
+
if opts.has_key?(:create)
|
|
34
34
|
class_eval "def #{member}_#{attribute}=(#{attribute});
|
|
35
35
|
return if #{attribute}.blank?
|
|
36
36
|
self.#{member} = #{klass}.find_or_create_by_#{attribute}(#{attribute})
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: anaf_habtm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 187
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 82
|
|
10
|
+
version: 0.0.82
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Tyler Gannon
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2010-07-
|
|
18
|
+
date: 2010-07-11 00:00:00 -07:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies: []
|
|
21
21
|
|