mongoid 0.4.7 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.7
1
+ 0.4.8
@@ -3,13 +3,10 @@ module Mongoid #:nodoc:
3
3
  module Hash #:nodoc:
4
4
  module Accessors #:nodoc:
5
5
  def insert(key, attrs)
6
- # TODO: Refactor me.
7
6
  store(key, attrs) if key.singular?
8
7
  if key.plural?
9
- if has_key?(key)
10
- elements = fetch(key)
11
- elements.delete_if { |e| (e[:_id] == attrs[:_id]) }
12
- elements << attrs
8
+ if elements = fetch(key, nil)
9
+ elements.delete_if { |e| (e[:_id] == attrs[:_id]) } << attrs
13
10
  else
14
11
  store(key, [attrs])
15
12
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongoid}
8
- s.version = "0.4.7"
8
+ s.version = "0.4.8"
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.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Durran Jordan