I like to use to deploy my applications because of its simplicity. The other nice thing is that they give you free developer space so if you are just getting an application up and running or just need to show it to a client you can do so without having to pay a bunch of money and spend a bunch of time setting up a VPS.
There are a few issues now and then. Morph has a large number of gems installed by default but occasionally I use one that they don't have. Today I ran into this problem. At first I thought no big deal I can just do a rake gems:unpack and drop the gems into the project and then deploy again.
Instead I get the following error:
ERROR: While executing gem ... (ArgumentError) Illformed requirement [""= 2.2.2""]
Turns out there is current a bug in Rails 2.1.0 and 2.2.0 that causes the unpack to barf if you specify a version number. Here's the link:
Since I am using the latest version of all the gems, my solution was to temporarily remove t...Continue Reading →
If you are using the acts_as_state_machine plugin to manage the state of your object keep this in mind: If you are going to have an object like an order or something similar that likely has a field state_id to relate in a geographic state then you need to be sure to rename the column that acts_as_state_machine plugin uses thus:
acts_as_state_machine :initial => :new, :column => :mode
Then you can get your object's state thus:
If you don't follow these steps ActiveRecord will override acts_as_state_machine and try to give you the geographic state (Utah, Idaho, etc) instead of the object state (new, edit, tired, etc). (In my case the value was always nil no matter how many times I tried to obj.next! to transition the states of my object. You will cry and scream and be in a very bad mood for a long time if you forget this fact.
Here's more info on the acts_as_state_machine plugin.Continue Reading →
One of the models in a project I am working on right now ends in 'status'. Rails handles that just find but in my tests I started noticing an odd error:
test: Lookup should belong_to lookup_status. (LookupTest): NameError: uninitialized constant LookupStatu
The Shoulda test looks like this:
Nothing to complicated there. Should recognizes the relationship just find but when it tries to find a class it goes looking for LookupStatu. I fixed this by adding the the class name to the relationship thus:
Continue Reading →
belongs_to :lookup_status, :class_name => 'LookupStatus'
We have to do an integration with Saleforce for a Rails project we are working on. I keep getting this error:
The :dependent option expects either :destroy or :delete (:nullify)
I posted to the Salesforce forums and didn't get any response so I did some more investigation. Turns out there is a bug and a patch:
Lucky for me the latest version of Rails has a feature that unpacks all of your gems into your vendor directory. I unpacked activesalesforce, made the code changes by applying the patch (which just removes :dependent => :nullify) and viola.Continue Reading →
We got a call today at The Plan Collection that was interesting. A guy was trying to print out one of our pages. Each time he tried his browser would crash. At first I thought, "that is just nuts. Html can't crash your browser." Then Jake tried it and it crashed Internet Explorer. Then I tried it and sure enough whenever you try to print a page on ThePlanCollection.com your browser will crash.
I decide to investigate and sure enough Google comes through. Specific tags in your html code will cause Internet Explorer to crash when you try to print.Continue Reading →