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
brianpWins has quit [Quit: brianpWins]
Sylvain2 has quit [Quit: Leaving.]
Sylvain1 has joined #datamapper
Sylvain1 has quit [Quit: Leaving.]
V8Energy has joined #datamapper
<V8Energy> is there a method create_or_update or something similar?
ksinkar has joined #datamapper
kurko_ has quit [Quit: Computer has gone to sleep.]
zombor has joined #datamapper
zombor has joined #datamapper
zombor has quit [Remote host closed the connection]
kurko_ has joined #datamapper
v0n has quit [Ping timeout: 260 seconds]
<onewheelskyward> V8Energy first_or_create
<onewheelskyward> obj = Model.first_or_create
<onewheelskyward> obj.add_stuff = x
<onewheelskyward> obj.save
kurko_ has quit [Quit: Computer has gone to sleep.]
snusnu has quit [Quit: Leaving.]
zombor has joined #datamapper
zombor has quit [Ping timeout: 260 seconds]
irclogger_com has quit [Ping timeout: 264 seconds]
mkf has quit [Ping timeout: 264 seconds]
mkf has joined #datamapper
irclogger_com has joined #datamapper
Sylvain1 has joined #datamapper
lightcap has joined #datamapper
tchebb has quit [Ping timeout: 264 seconds]
tchebb has joined #datamapper
zombor has joined #datamapper
zombor has quit [Ping timeout: 256 seconds]
tchebb has quit [Ping timeout: 276 seconds]
kurko_ has joined #datamapper
tchebb has joined #datamapper
brianpWins has joined #datamapper
<V8Energy> I have around 900 records in the table, Item.all.destroy seems to work very slowly the more records there are. is there another more efficient method?
<V8Energy> onewheelskyward: thanks
kurko_ has quit [Quit: Computer has gone to sleep.]
zombor has joined #datamapper
lightcap has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
zombor has quit [Ping timeout: 264 seconds]
Eiam has quit [Ping timeout: 260 seconds]
<onewheelskyward> V8Energy direct querying would be faster.
<onewheelskyward> or if you're wiping the table, model.auto_upgrade!
zombor has joined #datamapper
<onewheelskyward> Err, auto_migrate! destroys the data, rather.
zombor has quit [Ping timeout: 256 seconds]
solnic has left #datamapper [#datamapper]
V8Energy has quit [Ping timeout: 260 seconds]
mikecmpbll has joined #datamapper
knowtheory has joined #datamapper
grandy has quit [Ping timeout: 246 seconds]
kapowaz has quit [Ping timeout: 276 seconds]
kapowaz has joined #datamapper
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mikecmpbll has joined #datamapper
grandy has joined #datamapper
snusnu1 has joined #datamapper
postmodern has quit [Quit: Leaving]
akasper has joined #datamapper
snusnu1 has quit [Quit: Leaving.]
snusnu has joined #datamapper
mikecmpbll has quit [Quit: Computer has gone to sleep.]
mikecmpbll has joined #datamapper
zombor has joined #datamapper
kurko_ has joined #datamapper
akasper has quit [Quit: Leaving.]
<namelessjon> onewheelskyward: V8Energy has gone, so there's also Item.all.destroy!
kurko_ has left #datamapper ["["Textual IRC Client: www.textualapp.com"]"]
pabloh has joined #datamapper
v0n has joined #datamapper
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
akasper has joined #datamapper
mikecmpbll has joined #datamapper
V8Energy has joined #datamapper
<V8Energy> onewheelskyward: but that would erase all tables
<namelessjon> V8Energy: There's also Item.all.destroy!
<V8Energy> namelessjon: yes there is but it's VERY slow if there's 1000+ records
<namelessjon> V8Energy: Note the !
<V8Energy> oh
<V8Energy> i'll try that. thanks
<namelessjon> V8Energy: That makes it issue one scoped DELETE query, instead of N individual ones.
<namelessjon> V8Energy: You can also do "Item.all(:something => 'param').destory!" to scope it further in the table. Again, that would trigger one query only
<V8Energy> namelessjon: gotcha. thank you :)
ksinkar has quit [Ping timeout: 276 seconds]
mbj has joined #datamapper
Sylvain1 has quit [Quit: Leaving.]
mbj has quit [Quit: leaving]
mbj has joined #datamapper
zombor has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<onewheelskyward> ah, nice namelessjon
<onewheelskyward> I've never had to remove everything before. :)
Sylvain1 has joined #datamapper
mbj_ has joined #datamapper
mbj has quit [Ping timeout: 264 seconds]
mbj_ is now known as mbj
brianpWins has quit [Quit: brianpWins]
pabloh has quit [Remote host closed the connection]
snusnu has quit [Quit: Leaving.]
jhn has joined #datamapper
knowtheory has quit [Quit: Computer has gone to sleep]
jhn has quit [Ping timeout: 268 seconds]
Sylvain1 has left #datamapper [#datamapper]
mbj_ has joined #datamapper
mbj has quit [Ping timeout: 268 seconds]
<namelessjon> onewheelskyward: You can also scope it further via the all()
brianpWins has joined #datamapper
<onewheelskyward> I actually don't delete anything anymore, really. Just set the deleted status.
<namelessjon> heh. Well, for that, there's Item.all(:foo => 'bar').update!(:deleted => true) ;)
<onewheelskyward> nice
mbj has joined #datamapper
mbj_ has quit [Ping timeout: 240 seconds]
mouse-_ has quit [Ping timeout: 245 seconds]
onewheelskyward has quit [Ping timeout: 264 seconds]
mouse-_ has joined #datamapper
onewheelskyward has joined #datamapper
zombor has joined #datamapper
zombor has joined #datamapper
mbj_ has joined #datamapper
mbj has quit [Ping timeout: 264 seconds]
zombor has quit [Remote host closed the connection]
zombor has joined #datamapper
mbj_ has quit [Read error: Connection reset by peer]
zombor has quit [Remote host closed the connection]
mbj has joined #datamapper
postmodern has joined #datamapper
zombor has joined #datamapper
zombor has quit [Changing host]
zombor has joined #datamapper
brianpWins has quit [Quit: brianpWins]
brianpWins has joined #datamapper
mbj has quit [Quit: leaving]
mbj has joined #datamapper
zombor has quit [Remote host closed the connection]
Eiam has joined #datamapper
mbj has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 260 seconds]
zombor has joined #datamapper
zombor has joined #datamapper
lnormous has joined #datamapper
zombor has quit [Remote host closed the connection]
lnormous has quit [Ping timeout: 264 seconds]
zombor has joined #datamapper
zombor has quit [Remote host closed the connection]