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
lfox has joined #datamapper
rsim has joined #datamapper
skade has quit [Quit: Computer has gone to sleep.]
rsim has quit [Ping timeout: 245 seconds]
jordanyee has quit [Quit: MacBook went to sleep.]
jordanyee has joined #datamapper
v0n has joined #datamapper
v0n has quit [Ping timeout: 245 seconds]
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
lgierth has quit [Quit: Ex-Chat]
v0n has joined #datamapper
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
lfox has quit [Quit: ZZZzzz…]
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
develop7 has joined #datamapper
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
rsim has joined #datamapper
rsim has quit [Client Quit]
skade has joined #datamapper
develop7 has quit [Quit: Konversation terminated!]
rsim has joined #datamapper
mbj has joined #datamapper
mbj has quit [Quit: Lost terminal]
v0n has quit [Ping timeout: 252 seconds]
mikecmpbll has joined #datamapper
jordanyee has quit [Quit: MacBook went to sleep.]
skade has quit [Quit: Computer has gone to sleep.]
<Cinchy>
[gist] JBot error (at gist.github.com, rikai on 2014-01-28 18:55)
<rikai>
I'm probably just not understanding something, and i dont expect people to solve my issuesd for me, but if someone could nudge me in the right direction, it'd be very much appreciated. :)
<onewheelskyward>
Well, you said it worked recently.
<onewheelskyward>
What changed between then and now?
<rikai>
As far as i can tell, absolutely nothing. That's why i'm confused.
<onewheelskyward>
Something has to have changed. Perhaps environmentally.
<lgierth>
from the error i'd say the order in which the models are requried
<onewheelskyward>
That language is a little weird
<onewheelskyward>
Cannot find the parent_model Suggestion for Vote in suggestion
<onewheelskyward>
the relationships look ok
<onewheelskyward>
Do you have any unit tests?
<lgierth>
note that Dir.glob does not guarantee the results' order
<lgierth>
but your model definitions depend on it
<rikai>
I do not, this wasn't written by me, am just attempting to fix it with my limited knowledge.
<rikai>
lgierth: ahh, does it not? I was assuming it was just fed through alphabetically... hmmm
<lgierth>
rikai: it syscalls readdir and across operating systems it's not consistent
<Cinchy>
[gist] gist:45b53aadb2bdc6306582 (at gist.github.com, rikai on 2014-01-28 19:08)
<rikai>
Guess i should require the models manually, then. Thanks! :)
<lgierth>
nice
<lgierth>
you see the returned files are in pseudorandom order
<rikai>
i had been assuming incorrectly that they were in alphabetical order, because... That's the default for most things. Guess i should stop making assumptions.
<lgierth>
:)
<rikai>
Guess it just happened to work and something lower in the chain updated to change the ordering. Either way, that seems to have fixed it. You folks are wonderful. :D
<rikai>
Works perfectly manually specifying. :)
<lgierth>
hehe great
<rikai>
Now i just need to figure out the simplest way to do a .sort on the dir.glob before sending it into the loop, but that's not really a dm issue. Thanks again! :)
<lgierth>
Dir.glob("...").sort :)
<onewheelskyward>
I solved that by using an init.rb in my models folder that handles the requires. I needed it because some of them I auto_upgrade, and some I do not.
<lgierth>
interesting, i suppose the non-auto-upgraded tables are so big you wanna have more control?
<onewheelskyward>
no, they're managed by another app.
<onewheelskyward>
So I can't mess with them or bad things happen. :)
<onewheelskyward>
I've backdoored a sinatra api into a symfony-managed db.
<lgierth>
hehe yeah :]
<onewheelskyward>
I used dm-is-reflective for a while but doctrine was in compatibility mode so it didn't use serial fields in postgres. :(
<onewheelskyward>
I ended up writing my own sequence type for dm.
rsim has quit [Quit: Leaving.]
<lgierth>
dm is not a silver bullet for integration sadly
<lgierth>
i was lucky to only integrate with activerecord-style mysql
<onewheelskyward>
No, but it gave me an awful lot.
<rikai>
lgierth: actually, i already tried that as a quick and ditrty solution right away and that throws a stange error being used in the context of this loader that i dont really understand where it's coming from... "NoMethodError: undefined method `>' for true:TrueClass"
<lgierth>
sort takes an optional block that'll compare elements
<lgierth>
and returns the sorted array
<rikai>
Hah. Apparently i'm just an idiot today. :)
<lgierth>
heh i have "those" days as well
rsim has joined #datamapper
<rikai>
Fixed and fixed. Will have to send a little patch upstream for that.
<rikai>
Surprised that dir.glob isnt consistent across OSes... that's not the first time i've seen it used to load order-critical stuff...
<onewheelskyward>
Well, filesystems are weird.
<lgierth>
so there's a chance it'll eventually break, better hope it'll break in way you notice :)
<rikai>
Apparently dir.glob always sorts alphabetically on OS X, which is where this thing was developed, which explains why it was never noticed before. :P
<onewheelskyward>
You could always `ls *.rb`.each.
<onewheelskyward>
:)
<lgierth>
that's a good one!
<lgierth>
.split.each though
<onewheelskyward>
right
<onewheelskyward>
Then just don't deploy to windows.
<rikai>
Hm, searching "dir.glob *.rb" on github is scary.
<onewheelskyward>
Well, in most cases it's probably loading code that gets executes afterwards, which is ok.
<rikai>
True enough, but still. :P
lgierth has quit [Quit: Ex-Chat]
lfox has joined #datamapper
v0n has quit [Read error: Operation timed out]
rsim has quit [Quit: Leaving.]
v0n has joined #datamapper
v0n has quit [Client Quit]
v0n has joined #datamapper
frankbutt has joined #datamapper
frankbutt has left #datamapper [#datamapper]
skade has joined #datamapper
kenphused has quit [Quit: See Ya!]
kenphused has joined #datamapper
* kenphused
is away: I'm busy
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
mbj has quit [Quit: leaving]
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
skade has quit [Quit: Computer has gone to sleep.]