Skip to content

Instantly share code, notes, and snippets.

@stengland
Created May 3, 2011 15:54
Show Gist options
  • Save stengland/953600 to your computer and use it in GitHub Desktop.
Save stengland/953600 to your computer and use it in GitHub Desktop.
alias_attribute fails in mm 0.9
require 'mongo_mapper'
class Yester
include MongoMapper::Document
key :name, String
alias_attribute :foo, :name
alias_method :bar, :name
end
y = Yester.new
y.name = 'Dave'
=> "Dave"
y.foo
NoMethodError: undefined method 'foo' for #<Yester:0x7f677fb2f7d0>
y.bar
=> "Dave"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment