Skip to content

Instantly share code, notes, and snippets.

@marcoow
Created November 27, 2009 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcoow/244060 to your computer and use it in GitHub Desktop.
Save marcoow/244060 to your computer and use it in GitHub Desktop.
# Good:
class Post
belongs_to :author, :class_name => User.to_s # ActiveRecord
belongs_to :author, User.to_s # DataMapper
has_many :replies, :class_name => Comment.to_s # ActiveRecord
has n, :replies, Comment.to_s # DataMapper
end
# Bad:
class Post
belongs_to :author, :class_name => 'User' # ActiveRecord
belongs_to :author, 'User' # DataMapper
has_many :replies, :class_name => 'Comment' # ActiveRecord
has n, :replies, 'Comment' # DataMapper
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment