dm-polymorphic 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/associations.rb +3 -2
  3. metadata +3 -3
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ CLEAN.include "{log,pkg}/"
9
9
 
10
10
  spec = Gem::Specification.new do |s|
11
11
  s.name = "dm-polymorphic"
12
- s.version = "0.10.0"
12
+ s.version = "0.10.1"
13
13
  s.platform = Gem::Platform::RUBY
14
14
  s.has_rdoc = true
15
15
  s.extra_rdoc_files = %w[ README LICENSE TODO ]
data/lib/associations.rb CHANGED
@@ -4,7 +4,8 @@ module DataMapper
4
4
 
5
5
  alias_method :has_without_polymorphism, :has
6
6
 
7
- def has(cardinality, name, opts = {})
7
+ def has(cardinality, name, *args)
8
+ opts = args.extract_options!
8
9
  if interface = opts.delete(:polymorphically)
9
10
  # get the child model
10
11
  child_model_name = opts.fetch(:class_name, Extlib::Inflection.classify(name))
@@ -15,7 +16,7 @@ module DataMapper
15
16
  has_without_polymorphism cardinality, name, :child_key => [:"#{interface}_id"], :"#{interface}_class" => self
16
17
  child_klass.belongs_to :"#{belongs_to_name}", :child_key => [:"#{interface}_id"], :"#{interface}_class" => self
17
18
  else
18
- has_without_polymorphism(cardinality, name, opts)
19
+ has_without_polymorphism(cardinality, name, *(args + [opts]))
19
20
  end
20
21
  end
21
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-polymorphic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Neighman, Wayne E. Seguin, Ripta Pasay
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-03 00:00:00 -04:00
12
+ date: 2009-10-04 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.10.0
23
+ version: 0.10.1
24
24
  version:
25
25
  description: DataMapper plugin enabling simple ActiveRecord style polymorphism
26
26
  email: has.sox@gmail.com, wayneeseguin@gmail.com, github@r8y.org