Skip to content

Commit

Permalink
use titleize instead of humanize, check with camelcase class names
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Ladd authored and jnunemaker committed Nov 15, 2009
1 parent 105d944 commit b3fe9f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/mongo_mapper/rails_compatibility/document.rb
Expand Up @@ -6,7 +6,7 @@ def self.included(model)
alias_method :new_record?, :new?

def human_name
self.name.demodulize.humanize
self.name.demodulize.titleize
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mongo_mapper/rails_compatibility/embedded_document.rb
Expand Up @@ -19,7 +19,7 @@ def column_names
end

def human_name
self.name.demodulize.humanize
self.name.demodulize.titleize
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/unit/test_rails_compatibility.rb
@@ -1,7 +1,7 @@
require 'test_helper'

class TestRailsCompatibility < Test::Unit::TestCase
class Stuff
class BigStuff
include MongoMapper::Document
end

Expand Down Expand Up @@ -43,7 +43,7 @@ class SecondItem < Item

context "Document" do
should "implement human_name" do
Stuff.human_name.should == 'Stuff'
BigStuff.human_name.should == 'Big Stuff'
end
end
end

0 comments on commit b3fe9f2

Please sign in to comment.