mongoid 0.7.5 → 0.7.6

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.5
1
+ 0.7.6
@@ -5,6 +5,8 @@ module Mongoid #:nodoc:
5
5
 
6
6
  delegate :valid?, :to => :document
7
7
 
8
+ attr_accessor :klass
9
+
8
10
  # Creates the new association by finding the attributes in
9
11
  # the parent document with its name, and instantiating a
10
12
  # new document for it.
@@ -13,7 +15,7 @@ module Mongoid #:nodoc:
13
15
  # to the internal document itself.
14
16
  def initialize(name, document, options = {})
15
17
  class_name = options[:class_name]
16
- klass = class_name ? class_name.constantize : name.to_s.camelize.constantize
18
+ @klass = class_name ? class_name.constantize : name.to_s.camelize.constantize
17
19
  attributes = document.attributes[name]
18
20
  @document = klass.instantiate(attributes || {})
19
21
  @document.parentize(document, name)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongoid}
8
- s.version = "0.7.5"
8
+ s.version = "0.7.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Durran Jordan"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Durran Jordan