Skip to content

Instantly share code, notes, and snippets.

@eltiare
Created November 25, 2009 19:20
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 eltiare/242951 to your computer and use it in GitHub Desktop.
Save eltiare/242951 to your computer and use it in GitHub Desktop.
class User
include DataMapper::Resource
property :id, Serial
property :priority, Integer
end
class Posting
property :id, Serial
property :user_id, Integer, :index => true
belongs_to :user
end
# This used to work but I get this error: +options[:order]+ entry :priority does not map to a property in Posting
Posting.all(:order => [DataMapper::Query::Direction.new(User.properties[:priority], :desc)], :links => [:user])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment