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
<jordanyee>
Maybe lazy loading is working against me?
mbj has quit [Quit: leaving]
<jordanyee>
Despite that, I did get the end result I was after using dm-serializer with the methods association accessor. eg:
<Cinchy>
[gist] gist:8012930 (at gist.github.com, jordanyee on 2013-12-18 00:58)
<onewheelskyward>
Oh, hi, cinchy!
<jordanyee>
Was that not allowed?
<onewheelskyward>
Oh you did go with belongs to on location, that's why it has an idea.
<onewheelskyward>
No that's great, cinchy would tell us the title if it had one.
<jordanyee>
Oh haha
<jordanyee>
Yup, I went with belongs to because I thought that was causing location to not appear within business.
<onewheelskyward>
ah.
<jordanyee>
That said, it actually didn't fix that. dm-serializer did : P
<jordanyee>
Any thoughts on getting associations more than one level deep into json?
<jordanyee>
At this point, I'm thinking of creating a "view" where I'll construct a hash from the DM model instance and serializing it using a normal json serializer
g0bl1n has quit [Quit: Ex-Chat]
lnormous has quit [Ping timeout: 260 seconds]
lfox has joined #datamapper
lgierth has quit [Quit: Ex-Chat]
lnormous has joined #datamapper
lfox has quit [Quit: ZZZzzz…]
postmodern has quit [Quit: Leaving]
lnormous has quit [Ping timeout: 265 seconds]
zombor has joined #datamapper
lnormous has joined #datamapper
lnormous has quit [Ping timeout: 260 seconds]
zombor has quit [Remote host closed the connection]
rsim has joined #datamapper
lnormous has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
lnormous has quit [Ping timeout: 248 seconds]
lnormous has joined #datamapper
c0rn has joined #datamapper
c0rn has quit [Client Quit]
lnormous has quit [Ping timeout: 272 seconds]
lnormous has joined #datamapper
lnormous has quit [Ping timeout: 252 seconds]
rsim has joined #datamapper
flori_ has quit [Ping timeout: 246 seconds]
flori has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
lnormous has joined #datamapper
lnormous has quit [Ping timeout: 252 seconds]
lnormous has joined #datamapper
lnormous has quit [Ping timeout: 260 seconds]
lnormous has joined #datamapper
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
rsim has joined #datamapper
lnormous has quit [Ping timeout: 252 seconds]
skade has joined #datamapper
jordanyee has quit [*.net *.split]
dkubb has quit [*.net *.split]
flori has quit [*.net *.split]
_br_ has quit [*.net *.split]
indrek has quit [*.net *.split]
alessand1o has quit [*.net *.split]
mouse-_ has quit [*.net *.split]
shingara has quit [*.net *.split]
stormwind has quit [*.net *.split]
noca has quit [*.net *.split]
mkf has quit [*.net *.split]
onewheelskyward has quit [*.net *.split]
Frost has quit [*.net *.split]
skade has quit [*.net *.split]
grandy_ has quit [*.net *.split]
cbuxton_ has quit [*.net *.split]
dbussink has quit [*.net *.split]
namelessjon has quit [*.net *.split]
rtyler has quit [*.net *.split]
rsim has quit [*.net *.split]
irclogger_com has quit [*.net *.split]
viranch_ has quit [*.net *.split]
kapowaz has quit [*.net *.split]
ChanServ has quit [*.net *.split]
Eiam has quit [*.net *.split]
xargoon has quit [*.net *.split]
skade has joined #datamapper
dbussink has joined #datamapper
_br_ has joined #datamapper
Eiam has joined #datamapper
viranch_ has joined #datamapper
stormwind has joined #datamapper
noca has joined #datamapper
rtyler has joined #datamapper
alessand1o has joined #datamapper
rsim has joined #datamapper
jordanyee has joined #datamapper
dkubb has joined #datamapper
onewheelskyward has joined #datamapper
grandy_ has joined #datamapper
cbuxton_ has joined #datamapper
namelessjon has joined #datamapper
mouse-_ has joined #datamapper
shingara has joined #datamapper
flori has joined #datamapper
xargoon has joined #datamapper
ChanServ has joined #datamapper
irclogger_com has joined #datamapper
kapowaz has joined #datamapper
indrek has joined #datamapper
Frost has joined #datamapper
mkf has joined #datamapper
jordanyee has quit [*.net *.split]
dkubb has quit [*.net *.split]
flori has quit [*.net *.split]
_br_ has quit [*.net *.split]
indrek has quit [*.net *.split]
alessand1o has quit [*.net *.split]
mouse-_ has quit [*.net *.split]
shingara has quit [*.net *.split]
stormwind has quit [*.net *.split]
noca has quit [*.net *.split]
mkf has quit [*.net *.split]
onewheelskyward has quit [*.net *.split]
Frost has quit [*.net *.split]
skade has quit [*.net *.split]
grandy_ has quit [*.net *.split]
cbuxton_ has quit [*.net *.split]
dbussink has quit [*.net *.split]
namelessjon has quit [*.net *.split]
rtyler has quit [*.net *.split]
rsim has quit [*.net *.split]
irclogger_com has quit [*.net *.split]
viranch_ has quit [*.net *.split]
kapowaz has quit [*.net *.split]
ChanServ has quit [*.net *.split]
Eiam has quit [*.net *.split]
xargoon has quit [*.net *.split]
skade has joined #datamapper
Eiam has joined #datamapper
shingara has joined #datamapper
flori has joined #datamapper
mouse-_ has joined #datamapper
mkf has joined #datamapper
stormwind has joined #datamapper
dkubb has joined #datamapper
rsim has joined #datamapper
indrek has joined #datamapper
noca has joined #datamapper
_br_ has joined #datamapper
alessand1o has joined #datamapper
kapowaz has joined #datamapper
irclogger_com has joined #datamapper
jordanyee has joined #datamapper
namelessjon has joined #datamapper
viranch_ has joined #datamapper
grandy_ has joined #datamapper
xargoon has joined #datamapper
rtyler has joined #datamapper
cbuxton_ has joined #datamapper
dbussink has joined #datamapper
Frost has joined #datamapper
onewheelskyward has joined #datamapper
ChanServ has joined #datamapper
mikecmpbll has joined #datamapper
skade has quit [Quit: Computer has gone to sleep.]
cbuxton_ has quit [Read error: Connection reset by peer]
cbuxton_ has joined #datamapper
mikecmpbll has joined #datamapper
zombor has quit [Remote host closed the connection]
lfox has joined #datamapper
skade has quit [Ping timeout: 250 seconds]
skade has joined #datamapper
zombor has joined #datamapper
<dkubb>
jordanyee: yeah, in general I would never recommend using #to_json in a model. it's not a model's responsibility. if I could I would remove that from DM1. a view made with roar would be infinitely better
<dkubb>
at the time we added it we were going for feature parity in AR, but it was a bad idea in AR too only we didn't see it at the time
leokaito has joined #datamapper
akasper has joined #datamapper
leokaito has quit [Read error: Connection reset by peer]
skade has quit [Quit: Computer has gone to sleep.]
<mkristian>
jordanyee, I am using my ixtlan-babel gem to add both input filter as well output serializers (json,yaml and maybe xml - depends ActiveSupport) to AR, DM or virtus. well docu is probably bad. just my 2 cents.
rsim has quit [Quit: Leaving.]
lnormous has joined #datamapper
rsim has joined #datamapper
skade has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
<jordanyee>
@dkubb, mkristian: Thanks for the reply. I ended up using RABL to construct my JSON responses.
<jordanyee>
However Roar's bi-directional rendering and parsing is very interesting.
<jordanyee>
And from a cursory glance ixtlan-babel's input filters too.
<dkubb>
rabl is nice oo
<dkubb>
I always mix them up when I recommend them
<dkubb>
I use rabl on one project
<jordanyee>
Haha, well that's good to hear, having already implemented it!
<dkubb>
my hope is that roar's approach catches on though. I think it's brilliant to describe the view and then derive the parameter parsing from that
<dkubb>
:)
<dkubb>
the only real reason I might use to_json today is for quick and dirty debugging. I would probably never use it in a view that the user sees
<jordanyee>
Yeah, that's pretty cool
<jordanyee>
Yup, that's how I'm using it now too : P
<jordanyee>
Having implemented RABL and thus lacking parsing, out of curiosity, is it safe to pass params directly to model's create/update methods?
<jordanyee>
DM-validation will check the params passed and should also raise an error if unknown params are passed, right?
<jordanyee>
dkubb: : )
<dkubb>
yeah, we make it a point of trying to be safe with the arguments passed in
<dkubb>
although I think unknown attributes are just ignored
<dkubb>
actually, I'm wrong, it throws an exception