solnic changed the topic of #rom-rb to: Ruby Object Mapper | Mailing List: https://groups.google.com/forum/?fromgroups#!forum/rom-rb | Logs: http://irclog.whitequark.org/rom-rb
snusnu has quit [Quit: Leaving.]
lgierth has quit [Read error: Connection reset by peer]
lgierth has joined #rom-rb
lgierth has quit [Read error: Connection reset by peer]
lgierth has joined #rom-rb
<jonesdeini> hello everyone, I was trying out the has_many example in the rom-demo repo and I'm having some trouble. I posted in the ROM google group https://groups.google.com/forum/#!topic/rom-rb/iHqMXTX7Wk4
cbuxton_____ has quit [Ping timeout: 252 seconds]
lgierth has quit [Remote host closed the connection]
cbuxton______ has joined #rom-rb
lgierth has joined #rom-rb
lgierth_ has joined #rom-rb
lgierth has quit [Ping timeout: 252 seconds]
cflipse_ has quit [Quit: Ex-Chat]
therabidbanana has quit [Quit: leaving]
skade has joined #rom-rb
skade has quit [Ping timeout: 255 seconds]
cored has quit [Ping timeout: 252 seconds]
lgierth_ has quit [Quit: Ex-Chat]
lgierth has joined #rom-rb
jordanyee has quit [Quit: MacBook went to sleep.]
jordanyee has joined #rom-rb
skade has joined #rom-rb
skade has quit [Ping timeout: 252 seconds]
lgierth has quit [Quit: Ex-Chat]
lgierth has joined #rom-rb
skade has joined #rom-rb
skade has quit [Ping timeout: 276 seconds]
skade has joined #rom-rb
jordanyee has quit [Quit: MacBook went to sleep.]
skade has quit [Ping timeout: 252 seconds]
jordanyee has joined #rom-rb
skade has joined #rom-rb
skade has quit [Ping timeout: 252 seconds]
lgierth has quit [Quit: Ex-Chat]
rolfb has joined #rom-rb
skade has joined #rom-rb
snusnu has joined #rom-rb
robmiller has joined #rom-rb
snusnu has quit [Quit: Leaving.]
jfredett-w1 has quit [Read error: Connection reset by peer]
jfredett-w has joined #rom-rb
skade has quit [Ping timeout: 240 seconds]
snusnu has joined #rom-rb
skade has joined #rom-rb
snusnu has quit [Quit: Leaving.]
postmodern has quit [Quit: Leaving]
snusnu has joined #rom-rb
snusnu has quit [Quit: Leaving.]
snusnu has joined #rom-rb
skade has quit [Ping timeout: 240 seconds]
robmiller has quit [Quit: Leaving.]
robmiller has joined #rom-rb
skade has joined #rom-rb
robmiller has quit [Quit: Leaving.]
robmiller has joined #rom-rb
cored has joined #rom-rb
cored has quit [Changing host]
cored has joined #rom-rb
sferik has joined #rom-rb
sferik has quit [Quit: Textual IRC Client: www.textualapp.com]
jordanyee has quit [Quit: MacBook went to sleep.]
lgierth has joined #rom-rb
snusnu has quit [Quit: Leaving.]
snusnu has joined #rom-rb
rolfb has quit [Quit: Leaving...]
jordanyee has joined #rom-rb
rolfb has joined #rom-rb
snusnu has quit [Quit: Leaving.]
rolfb_ has joined #rom-rb
rolfb has quit [Read error: Connection reset by peer]
rolfb_ has quit [Quit: Leaving...]
skade has quit [Ping timeout: 252 seconds]
jordanyee has quit [Read error: Connection reset by peer]
jordanyee has joined #rom-rb
therabidbanana has joined #rom-rb
solnic has joined #rom-rb
snusnu has joined #rom-rb
<snusnu> yo solnic
<solnic> hey snusnu
jordanyee has quit [Quit: MacBook went to sleep.]
solnic has quit [Quit: Leaving...]
solnic has joined #rom-rb
<solnic> snusnu: hello?
<snusnu> solnic: sry, vim was fullscreen :)
<solnic> snusnu: LIKE IT SHOULD BE
<snusnu> ofcoursedude
<snusnu> :p
skade has joined #rom-rb
<snusnu> anyways, i was wondering what your thoughts on rename wrt wrap/group are
<solnic> snusnu: did you switch to tmux+vim finally? :)
<snusnu> no, not yet :)
<solnic> snusnu: ok?
<solnic> what rename? example?
<snusnu> so when you wrap a tuple, and you have to rename some of the wrapped attributes for a join .. how do you rename it "back" to their original names inside object?
<snusnu> say i have an account model with {id, login} and a person model with {id, name, account_id} .. i need to people.join(accounts.rename(id: :account_id)).wrap(account: [:account_id, :login])
<snusnu> but i want that wrapped account to have id, not account_id
<snusnu> and i don't want account_id in the person model
<snusnu> i was talking to dkubb about this quite a while ago (it was september last year iirc)
<snusnu> iirc he suggested that axiom might eventually just prefix all attributes in a wrapped/grouped relation with the relation name, but somehow i don't think that'll work, because not every relation has a name
<solnic> snusnu: I added a way to rename stuff in schema and then map it again in mappers to something else
<solnic> so in schema I'd set things so they are naturally joinable
<solnic> and "remap" in mappers
<solnic> snusnu: ^^ see?
<snusnu> yeah, i have my DM1 model key fields set to be naturally joinable too, but i don't yet have the "renaming back" part
<snusnu> one sec
<snusnu> yeah, so that seems to be the part where you allow "backend" attr names to differ from relation attr names … "but" i need the renaming for wrap/group :p
<solnic> yes it works with wrap/group
<snusnu> the rom specs i saw actually don't exhibit the behavior i desire
<snusnu> what i need is this (example syntax, not suggesting that): people.join(accounts.rename(id: :account_id)).wrap(account: [{original: :account_id, mapped: :id}, :login])
<solnic> do you have a spec?
<solnic> yeah that is achievable by renaming stuff in schema
<solnic> so you don't have to rename it later
<solnic> oh wait
<snusnu> ;)
<solnic> I see what you did there
<solnic> yeah I stumbled upon this use case
<solnic> I don't think it can be done right now given how axiom handles that
<snusnu> exactly
<solnic> it basically moves stuff from the tuple to wrapped one
<solnic> after that you can't change it
<snusnu> right
<solnic> yep
<solnic> full ack
<snusnu> damnit
<solnic> good bye
<solnic> ;D
<snusnu> lol
<snusnu> imo raw axiom should support that in some way
<snusnu> it's completely natural behavior
<snusnu> wrap/group "make no sense" if it leaves you with meaningless names
<solnic> that is correct
<solnic> I'm also not sure if it's OK that it moves everything w/o giving you ability to leave certain things on both sides
<snusnu> also i'm somewhat doubtful that some automatic prefixing/whatevering will work for the general case
<snusnu> that's just a guess tho
<solnic> like, if there's a common attribute (used to join things) it will be moved
<solnic> you can't have it on both sides
<solnic> it kinda makes sense from the theory POV
<snusnu> hm, not sure if that's a real problem, "unwrap" should take care of that?
<snusnu> also, it's mostly about FKs i guess? they should be "gone" in object land anyway?
<solnic> yes
<solnic> only FKs, actually
<solnic> true that
<solnic> that's why I'm not super worried about it ;)
<snusnu> yeah, it's a matter of LoD
<snusnu> me too
<solnic> LoD is shit, don't forget
<snusnu> lol
<snusnu> just sayin' (for reference) if you want person.account_id you can always do def account_id; account.id; end
<snusnu> anyways, what are we going to do about the core renaming issue?
<snusnu> we both need it (sooner or later)
* snusnu opens up axiom
<snusnu> solnic: what about something like adding a &block to https://github.com/dkubb/axiom/blob/master/lib/axiom/relation/operation/wrap.rb#L72 and yielding the newly created Wrap relation to it?
<snusnu> solnic: that way we should be able to perform a rename on it
<solnic> snusnu: +1
<snusnu> only thing is, i wonder how that works with unwrap
<solnic> it should just work, no?
<snusnu> no idea
<snusnu> the rename gets stored in the "ast" i guess, and somehow has to be reverted for unwrap
<snusnu> otoh, that might be done automatically, who knows ...:p
<solnic> I would expect it to be done automagically
skade has quit [Quit: WeeChat 0.4.3]
<snusnu> well, then we can only try that out i guess
<solnic> yep
solnic has quit [Quit: Leaving...]
solnic has joined #rom-rb
<snusnu> solnic: ok, so adding &block to #wrap signature doesn't work
<solnic> gaah
lgierth has quit [Quit: Ex-Chat]
<snusnu> solnic: no matter wether i rename the relation before or after the wrap
<snusnu> solnic: it'd be a bit clumsy anyway tho
<snusnu> we need another plan
<snusnu> solnic: hmm, it seems like what we really wanna do is not rename a wrapped relation, but rename attributes in https://github.com/dkubb/axiom/blob/master/lib/axiom/relation/operation/wrap.rb#L32
travis-ci has joined #rom-rb
<travis-ci> [travis-ci] rom-rb/devtools#271 (master - 817e152 : Markus Schirp): The build was broken.
<travis-ci> [travis-ci] Build details : http://travis-ci.org/rom-rb/devtools/builds/23695560
travis-ci has left #rom-rb [#rom-rb]
solnic has quit [Quit: Leaving...]
solnic has joined #rom-rb
snusnu has quit [Quit: Leaving.]
solnic has quit [Quit: Leaving...]
snusnu has joined #rom-rb
cschneid has quit [Ping timeout: 247 seconds]
cbuxton______ has quit [Ping timeout: 246 seconds]
avdi has quit [Ping timeout: 245 seconds]
ssut has quit [Ping timeout: 246 seconds]
robmiller has quit [Quit: Leaving.]
ssut has joined #rom-rb
cbuxton______ has joined #rom-rb
postmodern has joined #rom-rb
cschneid has joined #rom-rb
kapowaz has quit [Ping timeout: 246 seconds]
kapowaz has joined #rom-rb
avdi has joined #rom-rb
snusnu has quit [Quit: Leaving.]
jordanyee has joined #rom-rb
solnic has joined #rom-rb
solnic has quit [Quit: Leaving...]
solnic has joined #rom-rb
xybre has joined #rom-rb
<xybre> Virtus being used by Chassis -> http://hawkins.io/2014/02/introducing_chassis/
snusnu has joined #rom-rb
<snusnu> solnic: still around?
<solnic> snusnu: yep
<snusnu> solnic: i got it almost working in axiom (the wrap thing) but then i decided to use the same approach you took in rom, renaming the field in the mapper, cause as it happens, my mapper already supported it
<snusnu> solnic: also, it's much more straightforward to do
<solnic> hah!
robmiller has joined #rom-rb
<snusnu> solnic: another question tho, how come axiom-do-adapter generates sql errors when i wrap a wrapped relation with a gateway?
<snusnu> solnic: (re the first thing, all i had to do was add a map :id, from: :account_id :)
<snusnu> when i create a gateway relation proxying down to an already wrapped relation, the do-adapter produces a sql error
<snusnu> when i only wrap the join in a gateway, and perform the wrap on that, the correct sql gets generated
<snusnu> did you experience the same in rom?
<solnic> no I don't have that case yet
<solnic> it's dynamic now
<solnic> as in - rom doesn't build its relations with wrap/group yet
<solnic> you can do it dynamically yourself for now
<solnic> like I show in the demo
<snusnu> ah ok, well, then it's weird axiom behavior (bug)
<snusnu> imo it should be possible to create a join that gets then wrapped .. then wrap that in a gateway, and still have it execute the sql first, and wrap afterwards
<solnic> yeah man I would expect it to work
<snusnu> so yeah, now you know that it doesn't :p
<snusnu> i don't care much, but yeah, it clutters schema access code
<solnic> :/
<snusnu> then again, i'll just add #wrap and #group to my schema object for now
<snusnu> i guess i'll have something to show to you by tomorrow
<solnic> nice
snusnu has quit [Quit: Leaving.]
snusnu has joined #rom-rb
robmiller has quit [Quit: Leaving.]
robmiller has joined #rom-rb
<snusnu> solnic: do you know if conceptually, axiom supports nested wraps/groups ?
<solnic> snusnu: haven't ried
<snusnu> i will now
<jonesdeini> solnic sorry if you've already saw it, but I was having some trouble with the has_many example in rom-demo. I posted to the google group https://groups.google.com/forum/#!topic/rom-rb/iHqMXTX7Wk4
<solnic> jonesdeini: yes I saw it, I'll be looking into it tomorrow probably
<jonesdeini> solnic awesome, thank you
<postmodern> anyone here an expert on the ast gem?
<postmodern> thinking about using it to do polymorphic transformations
solnic has quit [Quit: Linkinus - http://linkinus.com]
snusnu has quit [Quit: Leaving.]
jgaskins has joined #rom-rb
snusnu has joined #rom-rb
lgierth has joined #rom-rb
onewheelskyward has quit [Quit: ZNC - http://znc.in]
onewheelskyward has joined #rom-rb