The 3.0.2 update to rails made a change in active support that creates an interference pattern failure in the jasmine-gem. Not jasmine, itself, mind you, just the standalone server that runs the jasmine tests, and not the server, but just the report runner. Thus, your tests are all green, but the jasmine suite fails anyway. You might see this error:
undefined method `merge' for #<JSON::Pure::Generator::State:0x102181890> (NoMethodError)
The selenium driver inside the jasmine gem is loadingjson_pureunless it can find an already loaded JSON class. json_pure was hacked by rails for other reasons, but it breaks JSON.generate. Madness ensues.
To fix this, you need to use something other than json_pure, at least in your test suite. The fix, fortunately, is pretty simple. Add the following line to your Gemfile
gem "json", "1.4.6"
This will load the json gem built with native extensions. The version number is not necessary to fix this problem, but we try to lock down versions as a standard practice.
This was maddeningly painful to pinpoint. I'm not sure if there's a long term solution to the problem either. You need a JSON library, but so do many others. Monkey patching the class seems really handy, but is prone to break behaviors.
Ask for Help
- Double-entry/ledger based accounting in Rails (i.e. Quickbooks in Rails for free)
Ideally would be tied in with user/role system where each accounting entry would be tied to a user, but also reconciled against a master account. Recommendations? Latest and greatest?
One suggestion was to look at the code that Wesabe open sourced code when they closed their doors.
- Error message when opening Rubymine "Invalid Git Root"
This is likely because the project included a submodule that wasn't configured correctly, fix this in under Rubymine's version control preferences.

Interesting Things
Test 404 handling (e.g.
rescue_from ActiveRecord::RecordNotFound, :with => :render_record_not_found) with Cucumber by temporarily settingActionController::Base.allow_rescue = true. This is usually set tofalseinfeatures/support/env.rbJSON.pretty_generatehates Rails 3Hashes
- Use window.postMessage to communicate between IFrames in a standard way
This should work in most modern browsers. Follow the Mozilla docs, NOT the various blog posts about this.
Interesting Things
- Browser History with Javascript and Page Based Json: One of our projects solved the vexing problem of browser history for a page that has initial page provided json with subsequent ajax updates. A simple page back operation will display the originally downloaded data, not the updated data. The solution is to add a unique id for each page, and store these ids in a cookie. When an ajax request updates the page it removes its page id from the cookie. When you use the back button, each page checks to see if its unique id is in the cookie, and if it is not, it forces a reload.
Really Simple History was mentioned as another way to manage javascript/ajax history. - Rubymine Build 784 has the Weirdest. Bug. Ever.: This may only be a problem if you work on a mac and you need to enter capital letters in rubymine dialogs like find and replace ;-). Many of us are fans of intellij/rubymine, but we wish they had a better test process. To be fair, rubymine is in public preview, so expect the occasional bug or two.
