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]
lgierth has quit [Quit: Ex-Chat]
zombor_ has quit [Read error: Connection reset by peer]
zombor_ has joined #datamapper
zombor_ has quit [Remote host closed the connection]
zombor_ has joined #datamapper
zombor_ has quit [Remote host closed the connection]
<bitmand>
I have an app using datamapper - all is great. But I want a completely different app to use the same database and models - can I have 2 apps running with the same set of datamapper models? (exactly the same - and of course I need to make sure that they are always in sync ) Or am I risking some sort of lock/race condition/etc ?
<mikecmpbll>
bitmand: shouldn't be any different to using any other ORM
<bitmand>
mikecmpbll: not sure I follow - you mean if I had "something else" query the database?
<mikecmpbll>
i meant, it's not really got anything to do with datamapper :)
<bitmand>
oh
<bitmand>
even better :)
<mikecmpbll>
you're just accessing a database ..
zombor_ has joined #datamapper
zombor_ has quit [Remote host closed the connection]
kleech has quit [Remote host closed the connection]
lfox has joined #datamapper
rsim has joined #datamapper
postmodern has joined #datamapper
micho has joined #datamapper
<micho>
hi! I am updating an attribute of my Datamapper object - it works only if some conditions are fulfilled (simple if). In another case it returns false, and doesn't update. I want to put it together with default update method, so: if in update method that specific parameter will be updated, I want to check the condition and update or not. As far as I did now, I can rewrite setter to myvalue (update calls setters for every param). Is
<micho>
it possible to return false value to update, if "my" updating will fail? The return value of setter is obviously not a good idea...
<Cinchy>
micho: [24d 3h 45m 20s ago] <dkubb> it's because of how sinatra works. each time you call the #user method you get a new instance back, so the first time it sets the age to 25, then the next time you get a new instance and call #save! on it
<Cinchy>
micho: [24d 3h 44m 47s ago] <dkubb> you can probably use @user ||= User.first(name: params[:name]) within the user method to make sure you use the same instance
zombor has quit [Remote host closed the connection]