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
mikecmpbll has quit [Quit: i've nodded off.]
ssut_ has joined #datamapper
_br_ has quit [Ping timeout: 240 seconds]
lgierth has quit [Ping timeout: 240 seconds]
dbussink has quit [Ping timeout: 276 seconds]
ssut has quit [Ping timeout: 276 seconds]
xargoon has quit [Ping timeout: 276 seconds]
ssut_ is now known as ssut
xargoon has joined #datamapper
dbussink has joined #datamapper
_br_ has joined #datamapper
lgierth has joined #datamapper
lgierth has quit [Quit: Ex-Chat]
skade has joined #datamapper
skade has quit [Quit: WeeChat 0.4.3]
mbj has joined #datamapper
mbj has quit [Ping timeout: 264 seconds]
mikecmpbll has joined #datamapper
lgierth has joined #datamapper
mbj has joined #datamapper
jammanbo has joined #datamapper
lgierth has quit [Quit: Ex-Chat]
limekin has joined #datamapper
<limekin> hello
<jammanbo> lo
<jammanbo> there's nobody here but you and me ..
<limekin> is there any good way of keeping migrations and running them in sinatra ?
<jammanbo> depends on your ORM really. What are you using?
<limekin> datamapper of course
<jammanbo> good luck with that
<jammanbo> there is a dm-migrations gem isnt there? Also, DM is very proactive in creating and modifying your tables, so I've never had the need for migrations
postmodern has quit [Quit: Leaving]
<jammanbo> oh, sorry limekin, i understand your "of course" now … thought this was the Sinatra chan B)
<limekin> its okay, so i just create and modify the table structures manually and interact with it using data-mapper ?
<jammanbo> you dont need to do anything if you've declared your properties in your models. Just run either DataMapper.auto_migrate! or .auto_upgrade! and it'll create/update the tables for you.
<limekin> thanks for the info
limekin has quit [Quit: Page closed]
mbj has quit [Remote host closed the connection]
mbj has joined #datamapper
djbender has joined #datamapper
mkristian has joined #datamapper
lgierth has joined #datamapper
<jammanbo> shot to nothing … Anyone got thoughts on dm-accepts_nested_attributes and validation errors? Specifically, the issue of the root object being valid even though a deeply nested resource is invalid / the errors being difficult to get to.
<mkristian> maybe the gem dm-validations-ext helps
<jammanbo> mkristian: It only goes one level deep :/
<mkristian> jammanbo, ahh - did not know that limitation
<jammanbo> Okay … is there a way to ask a resource for the associated resources that it has already loaded?
mbj has quit [Ping timeout: 252 seconds]
apoc has joined #datamapper
mikecmpbll has quit [Quit: ciao.]
apoc has left #datamapper [#datamapper]
mbj has joined #datamapper
apoc has joined #datamapper
mbj has quit [Read error: Connection reset by peer]
<apoc> hi, I have a query like this: Item.all({Item.tags.tagname => ['foo','bar']}) which gives me all items with either the 'foo' or 'bar' tags, how do I query all items that have the 'foo' AND 'bar' tags?
<mkristian> apoc, I would try: Item.all({Item.tags.tagname => 'foo' }) && Item.all({Item.tags.tagname => 'bar' })
<apoc> alright, is there no other way?
<jammanbo> Its a single & isn;it it?
<apoc> that I can use within the arguments?
<jammanbo> the above will do what you expect
<jammanbo> (until you start trying to apply "scopes" to the result)
<mkristian> jammanbo, probably - I keep on mixing this up
<apoc> the query is much more complex than that is the problem, with other conditions and dm-pagination
<jammanbo> so
<mkristian> apoc, you can add whatever more you need to each argument list
<jammanbo> you just keep buildind up the query using set operators
<apoc> ahh okay I think now I got it, thanks everyone
mikecmpbll has joined #datamapper
<jammanbo> like I said, stuff like this aint going to work for you:
<jammanbo> def self.paged; all.paged(params[:p]).per(20); end
<jammanbo> (Item.all(…) & Item.all(…)).paged
<jammanbo> AND YET THE FOLLOWING WILL WORK!
<jammanbo> (Item.all(…) & Item.all(…)).paged(params[:p]).per(20)
<jammanbo> bloody datamapper
mbj has joined #datamapper
<apoc> and no inject to build it dynamically
<apoc> I thought that would work, tags.map {|tag| Item.all(Item.tags.tagname => tag)}.inject {|a,b| a & b}
<jammanbo> tags.inject(Item.all) { |q, tag| q & Item.all(tagname: tag) }
<jammanbo> maybe
<jammanbo> prettier if nothing else
mbj has quit [Quit: leaving]
<apoc> oh wait there was another bug, that does work!
<apoc> yep works perfectly now
mkristian has quit [Quit: bye]
<jammanbo> do these words mean anything to anyone: Association, Lazy-Loading, Validation, Heisenbug?
<onewheelskyward> yes, yes, yes, yes.
<jammanbo> great!
<jammanbo> fix it for me
<jammanbo> :D
<onewheelskyward> fix what for you? I already answered the question. :)
<jammanbo> tell me what datamapper expects of me … I ask it if something is valid (it isnt) and says "yeah sure, why not". I look at the invalid thing and then ask it if it's valid, and it says "no"
<jammanbo> /ragequit
jammanbo has quit [Quit: Leaving.]
mikecmpbll has quit [Ping timeout: 252 seconds]
mbj has joined #datamapper
mkristian has joined #datamapper
<onewheelskyward> oh, you mean that thing where the relationships are invalid?
<onewheelskyward> I ran into that once, but it was my error. It just wasn't exposed.
<onewheelskyward> ah. They actually did ragequit.
mikecmpbll has joined #datamapper
postmodern has joined #datamapper
mikecmpbll has quit [Quit: i've nodded off.]
mikecmpbll has joined #datamapper
mkristian has quit [Quit: bye]
mbj has quit [Quit: leaving]
mikecmpbll has quit [Quit: ciao.]
mikecmpbll has joined #datamapper
mikecmpbll has quit [Client Quit]