Posts [ 10 ]

Topic: Bizarre methods breaking in production:

Several methods that work fine on my machine break spectacularly in production. Anyone's help would be appreciated enormously--I was hoping to be on time with this project....

Here's an example:I have a method called extended_create in my Piece class that takes the contents of [:content_assignments] in the params hash, builds a PieceAssignment object, and associates it with a given Piece. Here's what the method looks like:

As you can see, the parameters are being passed just dandily. Between the passing and the insert statement, things get lost. Why does this happen on the production system after a cap deploy and not locally? Baffling.

Another class is having little fits as well. The extended_create method on the PieceType class refuses to be acknowledged:

Moreover, it shouldn't even be calling that method in the first place! An attribute called extended_form contains either "true" or nothing. Whether the extended_create method is called depends on whether or not extended_form is true for a given class, and it's not for PieceType. (This value is pulled from the database.) Once again, works like a charm on my machine, ushers the apocalypse in production.

Guys, I am really perplexed. I have been finagling with this site and my production environment for months now, and I'd really like to get some Rails sites up and running best-practices style. This stuff is a little discouraging. I know it all comes together eventually, but is there a reason it all seems this tricky?