Skip to content

Commit

Permalink
Fix test for userstamps plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Jul 30, 2011
1 parent dcea63a commit 705aab2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongo_mapper/plugins/userstamps.rb
Expand Up @@ -6,7 +6,7 @@ module Userstamps

module ClassMethods
def userstamps!(options = {})
class_name = options.fetch(:class_name) { (options.fetch :class, 'User').to_s }
class_name = options[:class_name] || options[:class] ? options[:class].to_s : 'User'
key :creator_id, ObjectId
key :updater_id, ObjectId
belongs_to :creator, :class_name => class_name
Expand Down
4 changes: 4 additions & 0 deletions test/functional/test_userstamps.rb
@@ -1,6 +1,10 @@
require 'test_helper'

class UserstampsTest < Test::Unit::TestCase
class AltUser
include MongoMapper::Document
end

context "userstamping" do
setup do
@document = Doc do
Expand Down

0 comments on commit 705aab2

Please sign in to comment.