Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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])
Add Comment
Please, Sign In to add comment