Browse files

Merge branch '0.9'

* 0.9: (27 commits)
  Update variable name to reflect intention
  Fix Gemfile
  Remove .project file
  Fix for methods being included twice in to_xml
  Add test to expose serializer bug
  Default to empty hash if there is no config for the environment
  Fix test for userstamps plugin
  Test case for proper use of ActiveModel::Naming
  changed inspect so that only non-nil keys are shown by default - related to issue 194
  Uncomment and fix embedded doc expectations for nil values
  Fix attributes on Ruby 1.8
  Added tests and fixed some existing ones.
  Fix Issue 194.
  Fixing key fetch so it returns a string only, rather than a Class if :class key is present in the options hash.
  Removing logger requirement.
  Changing syntax for alternate User class to be more familiar for MM users. Now accepts an options hash with :class_name OR :class keys. If the neither key is present, it will default to the standard User class.
  Added to Userstamps plugin a way to use a unconventionally named User class (e.g., SpecialUser).
  Write a better test, making sure ReplSetConnection is passed options hash
  Added support for a Replica Set
  Add test for replica set connections from config that specifies multiple hosts

  • Loading branch information...
2 parents 99ad9bc + 7f13505 commit cbbf7d7b922c8217f191f6707ffb37c16d6a4fe1 @bkeepers bkeepers committed Sep 2, 2011
Showing with 5 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 Gemfile
  3. +3 −3 lib/mongo_mapper/plugins/inspect.rb
@@ -13,3 +13,4 @@ doc
@@ -3,8 +3,8 @@ gemspec
group(:development) do
gem 'bson_ext', '~> 1.3.0'
- gem 'SystemTimer', :platform => :ruby_18
+ gem 'SystemTimer', :platform => :mri_18
gem 'ruby-debug', :platform => :mri_18
gem 'ruby-debug19', :platform => :mri_19, :require => 'ruby-debug'
gem 'perftools.rb', :platform => :mri, :require => 'perftools'
@@ -5,9 +5,9 @@ module Inspect
extend ActiveSupport::Concern
module InstanceMethods
- def inspect(include_super=false)
- key_array = include_super ? key_names : attributes.keys
- attributes_as_nice_string = key_array.sort.collect do |name|
+ def inspect(include_nil = false)
+ keys = include_nil ? key_names : attributes.keys
+ attributes_as_nice_string = keys.sort.collect do |name|
"#{name}: #{self[name].inspect}"
end.join(", ")
"#<#{self.class} #{attributes_as_nice_string}>"

0 comments on commit cbbf7d7

Please sign in to comment.