dkubb changed the topic of #datamapper to: Datamapper v1.2.0 | Mailing List: http://is.gd/aa9D | Logs: http://is.gd/qWAL7V | DataMapper 2 Renamed to ROM, see #rom-rb for development
rbq has joined #datamapper
<rbq>
Hi there, maybe one of you can help me: Using DM 1.2.0 I'd like to :order something by the count of an (m:n) association. Is that possible?
<rbq>
More precisely, my `Movie has n, :tags, through: Resource` and the other way round. I tried things like `Tag.all :order => [ :movie_tag.count ]` but this doesn't work at all. Any help about where to look is highly appreciated.
<Cinchy>
[URL] ruby on rails - Datamapper: Sorting results through association - Stack Overflow
dkubb has joined #datamapper
<rbq>
mbj: Hmm, thx. I've read this thread before but couldn't figure out how to make it work with counting instead of a property.
<mbj>
rbq: You can define a view and a RO model on top.
<mbj>
rbq: Than you can sort on the count.
<rbq>
I guess that would work. Or maybe a cached counter property. I just hoped to find a simple solution that relies on DM features because I think it's quite easy to do in SQL.
lgierth has quit [Quit: Ex-Chat]
rbq has quit [Quit: rbq]
zombor has quit [Remote host closed the connection]
g0bl1n has joined #datamapper
zombor has joined #datamapper
zombor has quit [Remote host closed the connection]
<dank123>
however, I'm getting an error: http://localhost:8080/users/1/friendships --data "friend_id=2" DataObjects::IntegrityError: friendships.user_id may not be NULL
<dank123>
just wondering if the tutorial is out of date
solars has quit [Ping timeout: 248 seconds]
<dank123>
hello?
solars has joined #datamapper
rbq has joined #datamapper
lfox has quit [Ping timeout: 272 seconds]
raven has joined #datamapper
raven has quit [Client Quit]
postmodern has joined #datamapper
<dank123>
Hey, I've got a question So i'm trying to make a Self referential many to many relationship. Ex, a user has a friendship between a user I followed the tutorial here (http://datamapper.org/docs/associations.html), under the title "Self referential many to many relationships" however, I'm getting an error: http://localhost:8080/users/1/friendships --data "friend_id=2" DataObjects::IntegrityError: friendships.user_id may not be NU