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.]
<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]