Ask for Help
“License Finder doesn’t work with rails 2.3?”
This problem has come up a few times, but no one could recall what the solution was. Might be something about a rake task….
- MySQL Prefpane isn’t working with the Pivotal install on Lion. Seems like it expects a particular installation/configuration. Got around this by reinstalling MySQL from dmg. Another pivot suggested this could be a path issue that could be solved without a full reinstall.
- An older version of Chrome on Windows has a bug with mouse-enter and mouse-leave events. It will think you have left a div if you mouse over a text input contained within that div. Upgrading Chrome should fix this.
- event.layerX and event.layerY will be deprecated at some point… you’ll see these warnings now on the newest build of Chrome since it auto-updates.
Ask for Help
“accepts_nested_attributes_for doesn’t validate nested records? When a form contains two of the same nested attributes and the values of these should cause a validation error (e.g., both have the same email, which has a uniqueness constraint), the form saves properly, but the nested objects are invalid when accessed later.”
accepts_nested_attributes_for only validates against the database, but the records in this example would only be in memory. The best solution is to handroll a validator on the parent that iterates over the nested attributes and checks the constraints.
“A Pivot was getting some errors using minified jQuery in IE8, which went away when he used the un-minified version. Any other IE8/jQuery gotchas?”
A few have been mentioned at standup in the past few weeks, most notably some versions of jQuery crash IE8 entirely.
“Is there a way to generate a png from html server-side?”
You can use a command-line tool like webkit2png or there is some rack middleware that can generate pdfs and maybe pngs from html
“A pivot had a page that was requesting images after the page loaded, but couldn’t find where they were coming from…”
You can check the originator column of assets in firebug or the chrome developer panel. You can also try overriding jquery ajax to see each call (which you may not want to do if you have a lot of ajax calls).
“Chrome 11 + Webdriver + Java applets – Chrome 11 has changed the always allow Java plugins setting so that it is no longer global, and must be allowed for each applet. When running tests, Webdriver deletes the profile that stores this setting after each test run, causing specs to fail since a new dialog asking whether to allow the plugin pops up every time. Any ideas?”
The current fix seems to be to downgrade to Chrome 10.
“Does anyone know why using Spork + the ruby debugger just outputs ‘disconnected’ and doesn’t break at any breakpoints?”
The general consensus is to run tests on Spork and print out Spork when you want to debug.
- You should try Spork if you’re using Rails 3 and your tests are running slowly.