djsun-mongo_mapper 0.5.6.5 → 0.5.6.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.6.5
1
+ 0.5.6.6
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{djsun-mongo_mapper}
8
- s.version = "0.5.6.5"
8
+ s.version = "0.5.6.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["John Nunemaker"]
12
- s.date = %q{2009-11-03}
12
+ s.date = %q{2009-11-04}
13
13
  s.default_executable = %q{mmconsole}
14
14
  s.description = %q{Awesome gem for modeling your domain and storing it in mongo}
15
15
  s.email = %q{nunemaker@gmail.com}
@@ -1,6 +1,8 @@
1
1
  module ConstantHelper
2
2
  def self.lookup(class_name, scope)
3
- if namespaced?(class_name)
3
+ if class_name.is_a?(Class)
4
+ class_name
5
+ elsif namespaced?(class_name)
4
6
  class_name.constantize
5
7
  else
6
8
  lookup_in_parent(class_name, scope)
@@ -26,10 +26,16 @@ class AssociationBaseTest < Test::Unit::TestCase
26
26
  Base.new(:many, :smart_people).class_name.should == 'SmartPerson'
27
27
  end
28
28
 
29
- should "be changeable using class_name option" do
29
+ should "be changeable using class_name option with a string" do
30
30
  base = Base.new(:many, :smart_people, :class_name => 'IntelligentPerson')
31
31
  base.class_name.should == 'IntelligentPerson'
32
32
  end
33
+
34
+ should "be changeable using class_name option with a constant" do
35
+ class IntelligentPerson; end
36
+ base = Base.new(:many, :smart_people, :class_name => IntelligentPerson)
37
+ base.class_name.should == IntelligentPerson
38
+ end
33
39
  end
34
40
 
35
41
  context "klass" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: djsun-mongo_mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6.5
4
+ version: 0.5.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-03 00:00:00 -05:00
12
+ date: 2009-11-04 00:00:00 -05:00
13
13
  default_executable: mmconsole
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency