djsun-mongomapper 0.3.5.4 → 0.3.5.5

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 CHANGED
@@ -12,7 +12,7 @@ begin
12
12
  gem.rubyforge_project = "mongomapper"
13
13
 
14
14
  gem.add_dependency('activesupport')
15
- gem.add_dependency('mongodb-mongo', '0.14')
15
+ gem.add_dependency('mongodb-mongo', '0.14.1')
16
16
  gem.add_dependency('jnunemaker-validatable', '1.7.2')
17
17
 
18
18
  gem.add_development_dependency('mocha', '0.9.4')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.5
1
+ 0.3.5.5
@@ -196,10 +196,15 @@ module MongoMapper
196
196
  end
197
197
  end
198
198
 
199
- attrs[name] = value unless value.nil?
199
+ attrs[name] = value
200
200
  end
201
201
  attrs.merge!(embedded_association_attributes)
202
202
  end
203
+
204
+ # all attributes, even ones with null values
205
+ def all_attributes
206
+
207
+ end
203
208
 
204
209
  def [](name)
205
210
  read_attribute(name)
data/mongomapper.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongomapper}
8
- s.version = "0.3.5.4"
8
+ s.version = "0.3.5.5"
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"]
@@ -13,6 +13,7 @@ class JsonSerializationTest < Test::Unit::TestCase
13
13
  key :created_at, Time
14
14
  key :awesome, Boolean
15
15
  key :preferences, Hash
16
+ key :hiding, String
16
17
 
17
18
  many :tags, :class_name => 'JsonSerializationTest::Tag'
18
19
  end
@@ -42,6 +43,7 @@ class JsonSerializationTest < Test::Unit::TestCase
42
43
  assert json.include?(%("created_at":#{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}))
43
44
  assert_match %r{"awesome":true}, json
44
45
  assert_match %r{"preferences":\{"shows":"anime"\}}, json
46
+ assert_match %r{"hiding":null}, json
45
47
  end
46
48
 
47
49
  should "allow attribute filtering with only" do
@@ -53,6 +55,7 @@ class JsonSerializationTest < Test::Unit::TestCase
53
55
  assert_no_match %r{"awesome"}, json
54
56
  assert_no_match %r{"created_at"}, json
55
57
  assert_no_match %r{"preferences"}, json
58
+ assert_no_match %r{"hiding"}, json
56
59
  end
57
60
 
58
61
  should "allow attribute filtering with except" do
@@ -64,6 +67,7 @@ class JsonSerializationTest < Test::Unit::TestCase
64
67
  assert_match %r{"awesome"}, json
65
68
  assert_match %r{"created_at"}, json
66
69
  assert_match %r{"preferences"}, json
70
+ assert_match %r{"hiding"}, json
67
71
  end
68
72
 
69
73
  context "_id key" do
@@ -141,7 +145,7 @@ class JsonSerializationTest < Test::Unit::TestCase
141
145
  Contact.new(:name => 'Mary', :age => 14)
142
146
  ]
143
147
  end
144
-
148
+
145
149
  should "allow attribute filtering with only" do
146
150
  json = @contacts.to_json(:only => :name)
147
151
  assert_match %r{\{"name":"David"\}}, json
@@ -342,12 +342,12 @@ class EmbeddedDocumentTest < Test::Unit::TestCase
342
342
  context "attributes" do
343
343
  should "default to hash with _id" do
344
344
  doc = @document.new
345
- doc.attributes.keys.should == ['_id']
345
+ doc.attributes.keys.sort.should == %w(_id age name)
346
346
  end
347
347
 
348
- should "return all keys that aren't nil" do
348
+ should "return all keys, including ones with nil values" do
349
349
  doc = @document.new(:name => 'string', :age => nil)
350
- doc.attributes.keys.sort.should == ['_id', 'name']
350
+ doc.attributes.keys.sort.should == %w(_id age name)
351
351
  doc.attributes.values.should include('string')
352
352
  end
353
353
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: djsun-mongomapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5.4
4
+ version: 0.3.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker