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:
<jordanyee> business.to_json(methods: [:location])
<jordanyee> Unfortunately, it looks like that solution only goes 1-level deep. So I can't get at Location in Business if Business is in BusinessOwner
<onewheelskyward> oh lol
<onewheelskyward> What's businessowner?
<jordanyee> It would be a model representing the person who owns the business
<jordanyee> So I could output all the businesses including their locations a business owner has
<onewheelskyward> Oh I see
<onewheelskyward> so there's businessowner->business(location)->customer(location)
<jordanyee> Not quite, umm.
<jordanyee> Let me put together a gist really fast
<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.]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mikecmpbll has joined #datamapper
mbj has joined #datamapper
zombor has joined #datamapper
zombor has joined #datamapper
zombor has quit [Changing host]
zombor has quit [Remote host closed the connection]
mkristian has joined #datamapper
zombor has joined #datamapper
zombor has joined #datamapper
zombor has quit [Changing host]
skade has joined #datamapper
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
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.]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mikecmpbll has joined #datamapper
<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
<mbj> dkubb: From todays POV I consider these kind of "assign params to dm-1 ar resource" as a big smell.
<mbj> *dm1 or AR resource
<mbj> dkubb: There should be an additional layer between, dedicated to fix the impedance mismatch from http params and an object model.
<jordanyee> dkubb: That's great, thanks for the help!
akasper has quit [Quit: Leaving.]
lnormous has quit [Ping timeout: 272 seconds]
rsim has joined #datamapper
<dkubb> mbj: I typically write form objects now that do this
<dkubb> I design the form object around my UI, and it coordinates things with the underlying objects
<dkubb> I use dependency injection so I can test it easily with mocks
<mbj> dkubb: Yeah. Makes sense.
lfox has quit [Quit: ZZZzzz…]
rsim has quit [Ping timeout: 245 seconds]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
akasper has joined #datamapper
lfox has joined #datamapper
_whitelogger_ has joined #datamapper
_whitelogger has quit [Ping timeout: 252 seconds]
lfox has quit [*.net *.split]
jordanyee has quit [*.net *.split]
dkubb has quit [*.net *.split]
zombor has quit [*.net *.split]
flori has quit [*.net *.split]
mbj has quit [*.net *.split]
_br_ has quit [*.net *.split]
indrek has quit [*.net *.split]
cbuxton_ 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]
skade has quit [*.net *.split]
mkristian has quit [*.net *.split]
mkf has quit [*.net *.split]
onewheelskyward has quit [*.net *.split]
Frost has quit [*.net *.split]
akasper has quit [*.net *.split]
grandy_ has quit [*.net *.split]
dbussink has quit [*.net *.split]
namelessjon has quit [*.net *.split]
rtyler 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]
lfox has joined #datamapper
skade has joined #datamapper
jordanyee has joined #datamapper
indrek has joined #datamapper
cbuxton_ has joined #datamapper
akasper has joined #datamapper
flori has joined #datamapper
stormwind has joined #datamapper
mkristian has joined #datamapper
zombor has joined #datamapper
mkf has joined #datamapper
dkubb has joined #datamapper
Eiam has joined #datamapper
_br_ has joined #datamapper
irclogger_com has joined #datamapper
viranch_ has joined #datamapper
noca has joined #datamapper
kapowaz has joined #datamapper
mbj has joined #datamapper
onewheelskyward has joined #datamapper
xargoon has joined #datamapper
grandy_ has joined #datamapper
alessand1o has joined #datamapper
shingara has joined #datamapper
namelessjon has joined #datamapper
mouse-_ has joined #datamapper
dbussink has joined #datamapper
rtyler has joined #datamapper
ChanServ has joined #datamapper
Frost has joined #datamapper
cschneid has quit [Max SendQ exceeded]
cschneid has joined #datamapper
skade has quit [Quit: Textual IRC Client: www.textualapp.com]
akasper has quit [Quit: Leaving.]
akasper has joined #datamapper
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
DireFog has quit [Quit: No Ping reply in 180 seconds.]
tngn has joined #datamapper
DireFog_ has joined #datamapper
g0bl1n has joined #datamapper
g0bl1n has joined #datamapper
tngn has quit [Ping timeout: 272 seconds]
jShaf has joined #datamapper
mkristian has quit [Quit: bye]
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
jordanyee has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mbj has quit [Ping timeout: 272 seconds]
mbj has joined #datamapper
rsim has joined #datamapper
jordanyee has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
jordanyee has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jordanyee has joined #datamapper
jordanyee has quit [Client Quit]
jordanyee has joined #datamapper
zombor has quit [Ping timeout: 240 seconds]
zombor has joined #datamapper
zombor has quit [Remote host closed the connection]
rsim has joined #datamapper
jordanyee has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zombor has joined #datamapper
lgierth has joined #datamapper
mbj has quit [Quit: leaving]
lfox has quit [Quit: ZZZzzz…]
jordanyee has joined #datamapper
zombor has quit [Remote host closed the connection]
akasper has quit [Quit: Leaving.]
akasper has joined #datamapper
akasper has quit [Client Quit]
rsim has quit [Quit: Leaving.]