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
peneconleche has joined #datamapper
<Frost>
namelessjon: it was, and it was not correct.
<Frost>
namelessjon: It was me not having proper constraints on my associations.
peneconleche has quit [Quit: Leaving...]
zombor has joined #datamapper
dkubb has joined #datamapper
zombor has quit [Remote host closed the connection]
mbj has joined #datamapper
mbj has quit [Ping timeout: 260 seconds]
<namelessjon>
Frost: I was more referring to the order dependence of the options
zombor has joined #datamapper
zombor has quit [Remote host closed the connection]
zombor has joined #datamapper
lnormous has joined #datamapper
<lnormous>
I'm having some trouble writing a custom setter
<lnormous>
I have a property with type PostGISGeometry
<lnormous>
I want to be able to set the latitude and longitude, so I can do object.update(:latitude => x, :longitude => y), so have written latitude= and longitude= methods, which work perfectly when an object is created, and don't seem to work when it's updated
zombor has quit [Remote host closed the connection]
<Cinchy>
[gist] gist:8163094 (at gist.github.com, lukenorman on 2013-12-28 19:15)
<lnormous>
I suspect it's to do with the model becoming dirty before the update happens - maybe I'm just approaching it the wrong way, and would certainly welcome any input
zombor_ has quit [Ping timeout: 252 seconds]
dkubb has joined #datamapper
<lnormous>
dkubb: You've been really helpful with answering my questions in the past, and if you could spare a minute or two I would appreciate it
<dkubb>
lnormous: sure, what's your question? or should I check the backlog?
<lnormous>
Basically, I have a property with type POSTGisGeometry
<lnormous>
I want to be able to set the latitude and longitude, so I can do object.update(:latitude => x, :longitude => y), so have written latitude= and longitude= methods, which work perfectly when an object is created, and don't seem to work when it's updated
<Cinchy>
[gist] gist:8163221 (at gist.github.com, dkubb on 2013-12-28 19:31)
<lnormous>
Thank you! I've been stuck on this for a couple of hours, trying various different ways - that's a really nice elegant solution
<dkubb>
cool
<dkubb>
it's untested on my end since I don't have dm-postgis, but I figured you could verify it pretty quickly
<dkubb>
the key is that since the value is being overwritten, DM notices that the value has changed
zombor has joined #datamapper
zombor has quit [Ping timeout: 245 seconds]
lnormous has quit [Quit: Leaving]
zombor has joined #datamapper
zombor has quit [Ping timeout: 272 seconds]
lgierth has joined #datamapper
zombor has joined #datamapper
lnormous has joined #datamapper
zombor has quit [Remote host closed the connection]
<lnormous>
dkubb: Sorry to bother you again. What's the best way of getting a table name at runtime. doing Class.storage_name works fine in my shell, but throws errors in my application