I built an app that works (basics, no real customisation) for the core
3-model... http://hobo3model.heroku.com - just to test. It works fine, so
this issue is something to do with deployment and migration related issues,
I suspect, not the differences between Postgres local and Heroku's Postgres
(which is a serious relief).
Fortunately, caught this before drilling too deep on the dev system and
making it hard to recover. I suspect that the issue is to do with the
specific order in which associations were developed on the dev machine.
Something, somehow, is being inherited locally. So, revert, clean out the
database entirely, regenerate the models and apply the various controller
constraints and model view controls, and I hope I'll be back where I should
be. Unless heroku remembers something I'd prefer that it didn't, of course
:)
But... I'd still like a clue on debugging differences between dev and
production in hobo. In straight Rails, I'd be dumping Rails.logger
statements all over the shop, and hoping to detect where the problem
emerged. In Hobo? With all the automated generation? Dunno. That seems old
and clunky. Clues? Please?
Cheers, JeremyC
On Sunday, 15 June 2014 22:40:40 UTC+1, JezC wrote:
>
> Hi, got an odd problem that I don't know how to debug in Hobo. I've a
> simple three model application. I might even be able to set it up again,
> with generic model names, it's that simple. :)
>
> Users have Things, Things have Stuff that is owned by Users.
>
> Pretty similar to the Agility Tutorial, except even simpler. :)
>
> I can run around this app in development mode on my desktop system with no
> problem. I'm using Postgres on both development and production systems -
> I've been stung by this "database agnostic" thing before... So as close to
> the same DB as possible on dev and production systems.
>
> I have (I say this, because I expect that this is the cause of the
> problem), a "children :stuffs" in the Thing model. That, I think, causes
> the need to refer to the 'thing_id" in the "Stuff" instance. And that works
> on my dev machine. I get lists of Stuff that are attached to Things. And
> the Things and the Stuff are owned by Users, as they should be. So...
> fairly sure that I have the associations working. Nothing screams and
> fails, at least.
>
> But, when I run on Heroku, in production mode, I get a message about
> 'thing_id":
>
> GET "/things/1-a-thing"
> ...
>
> app/views/taglibs/auto/rapid/pages.dryml:74:in `show_page__for_thing'
>
> ActionView::Template::Error (unknown attribute: thing_id):
>
> Pretty sure this is the attempt to use Stuff to find the matching
> thing_id's. And there is a table for Stuff with a thing_id field in both
> Dev and Production databases. Otherwise the dev machine wouldn't work, eh?
> Using 'heroku pg:psql" and the "\\d" command to show the tables and the
> fields in each table, shows the tables look as I'd expect, with the Stuff
> table having a thing_id field.
>
> So... obviously I haven't run the db migration on heroku? I did the whole
> "heroku pg:reset" thing to make sure that I had new clean DB built from
> the migrations. Did the equivalent ('rake db:reset') on the dev machine and
> re-checked. Same thing. Dev machine runs through all tests. The moment that
> I add a new Thing and try to look at it, with no Stuff yet added, I get the
> error on the production server. Every time. And when I try the exact same
> operation on the dev machine, it works. Puzzling, eh?
>
> So... what's the right way to debug Hobo to find out what is happening?
>
> And if anyone has a vague idea of why the dev and production modes result
> in differences, I'd love to hear. Do note that I'm using Postgres on my dev
> machine and the thing-that-is-pretty-much-postgres on Heroku. I have
> suspicions about that difference. But I need some way to debug via DRYML on
> the production server, I guess. What's the best way to do that?
>
> TIA, JeremyC.
>
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.