Created
December 10, 2009 03:37
-
-
Save jacqui/253091 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bar | |
include MongoMapper::Document | |
normalize_attributes :name | |
key :name, String | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading development environment (Rails 2.3.5) | |
rails development: main | |
>> Bar | |
NoMethodError: undefined method `normalize_attributes' for Bar:Class | |
from /Users/202362/Code/foo/vendor/gems/mongo_mapper-0.6.6/lib/mongo_mapper/document.rb:328:in `method_missing' | |
from /Users/202362/Code/foo/app/models/bar.rb:4 | |
from /Users/202362/Code/foo/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `load_without_new_constant_marking' | |
from /Users/202362/Code/foo/vendor/rails/activesupport/lib/active_support/dependencies.rb:380:in `load_file' | |
from /Users/202362/Code/foo/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in' | |
from /Users/202362/Code/foo/vendor/rails/activesupport/lib/active_support/dependencies.rb:379:in `load_file' | |
from /Users/202362/Code/foo/vendor/rails/activesupport/lib/active_support/dependencies.rb:259:in `require_or_load' | |
from /Users/202362/Code/foo/vendor/rails/activesupport/lib/active_support/dependencies.rb:425:in `load_missing_constant' | |
from /Users/202362/Code/foo/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing' | |
from /Users/202362/Code/foo/vendor/rails/activesupport/lib/active_support/dependencies.rb:92:in `const_missing' | |
from (irb):1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.join(File.dirname(__FILE__), *%w[.. lib attribute_normalizer]) | |
module MongoMapper | |
module Document | |
module ClassMethods | |
include AttributeNormalizer | |
def normalize_attributes(*args) | |
puts "Now I am over heah!" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment