Guest User

Untitled

a guest
Apr 25th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. class User
  2. include DataMapper::Resource
  3.  
  4.  
  5. property :id, Serial
  6. property :priority, Integer
  7. end
  8.  
  9. class Posting
  10. property :id, Serial
  11. property :user_id, Integer, :index => true
  12. belongs_to :user
  13. end
  14.  
  15. # This used to work but I get this error: +options[:order]+ entry :priority does not map to a property in Posting
  16. Posting.all(:order => [DataMapper::Query::Direction.new(User.properties[:priority], :desc)], :links => [:user])
Add Comment
Please, Sign In to add comment