- ARMailer and ExceptionNotifer: A match not so much made in heaven.
If you use the ExceptionNotifier plugin (and if you don’t, why not?) and you install the ARMailer plugin, your app will stop sending the exception notifications. You have been warned. Initial reports suggest that fixing the problem is relatively straightforward.
For those not in the know, ARMailer is a plugin that queues all outbound email in your database, to be sent later by a cron job or something similar. Good for not clogging up your server with email processing during peak load.
Ask for Help
“Is it okay to load a Flash widget multiple times on a single page?”
General murmuring led to the conclusion that this works fine.
- We discovered why a Flash widget was reloading itself: changes the CSS
position value. We were hiding the Flash widget by moving it’s containing
div off the page with
position: absolute; left: -9000, and removing the class that had those values to show it again. It turns out that changing that
position value causes the Flash to reload. By keeping the
position:absolute setting when we both show and hide our container div, the Flash no longer reloads.
Ask for Help
“When using Rails’s date_select helper, is there a corresponding helper method to turn that date format into a Date object in the controller?”
Some Snippets are available, but how about a Rails built-in solution?
- Where am I? — Ever need to find the name of the method you are currently within? Here’s a
this_method method! The magic is in the REGEX, of course.
caller =~ /`([^']*)'/ and $1
- One project wanted to test a very ActiveRecord-specific Module in an isolated, generic way. After spending time researching techniques of mocking and stubbing the many, many ActiveRecord methods that would be touched, they decided to just dynamically create an ActiveRecord and a DB Table for it on the fly! They even used single table inheritance (STI)
describe "MyMagicModule Mixin" do
:force => true do |t|
t.integer "some_model_b_id", :limit => 11
class SomeBaseModel < ActiveRecord::Base;end
class SomeModelA < SomeBaseModel
class SomeModelB < SomeBaseModel
it 'should use special belongs_to stuff from MyMagicModule' do
model_a = SomeModelA.create!(
:name=> "Model A",
:some_model_be => SomeModelB.create!(:name => "Model B"))
# test the functionality from MyMagicModule
- Rake migrations check if a migrations table is in sync with migration file and it does not really check what the state of the data in database.
Ask for Help
“Can we use migrations to load static data into an application”
People usually create a separate rake task to bootstap. Mixing it with migration was not working well before.
A developer accidentally committed to an SVN external. Switching the SVN user to have read-only access to the external.
Casebook’s ccrb + Funkytown + JsUnit build opens parallels on development boxes. The issue is probably with the Funkytown configuration.
Adam Keyes is coming in to talk to us during lunch today.
Casebook is moving to Git.
“All your brunch is belong to us” – Damon McCormick
NYC Ruby Tomorrow
Erector 0.4.200 was released. New features include:
The Widget#join method, which joins an Array of text/widgets, with a separator which is text or a widget. This translates the standard idiom, without needing calls to raw.
join [ "People", "Projects" ], ” | “
Added a Pretty Printer which can be enabled by Erector::Doc.prettyprint_default = true (for example in development.rb)
JsUnit runs very slowly on the CI box on OSX and eventually times out, unless we open a VNC window to the machine. We tried upgrading to a more recent JsUnit, but couldn’t get that to work at all.
Nanite looks really cool.
One interesting thing this morning:
The RailsEnvy blog had a segment talking about a team of engineers building a series of social network plugins using the Pivotal Lab’s technology: Dessert.
Those of us used to Desert (one ‘s’) were wondering what Dessert might be, leading to this quip from Adam:
“Dessert is Desert with a lot of syntactic sugar.”
Ask For Help
Once again, a project is asking for everyone’s favorite IE 6 .PNG alpha transparency fixes — more rounded corners! Examples include the CSS Behavior code, using .PNGs or .GIFs with on/off transparency, regulating IE 6 to the square Web 1.0 world, and even using on/off transparency and just knocking a pixel or two off of corners for a “good enough” rounded look.
What are your favorite IE 6 rounded-corner and/or alpha-transparency fixes?
Ask for Help
One of our clients is looking for high-quality third-party chat services/libraries.
10.5.5 and screen sharing
The Mac screen sharing application includes a host of interesting power features. Unfortunately, upgrading to Mac 10.5.5 causes these features to go away. Workarounds at this point are to store off the application and re-install it. Or to pay $300 for the official solution. Whichever.
Additional routing-related helper methods
It can be useful to create helper methods designed to extend the routing helpers offered by routes.rb.. power “_path” and “_url” methods. While the easy solution is to define these methods in your view helper layer (the most common client of these methods), a more complete solution is to use a pattern like this:
ActionController::Routing::Routes.draw do |map|
... normal routes ...
Any methods added to ActionController::Routing::Helpers will be available in all of the same places that named routes are defined – controllers, views, and ActionController::UrlWriter includers.
Testing Flash in Selenium
Most Flash applications render an inline image in addition to the Flash itself. This image updates as the Flash updates, and appears to be used for caching purposes.
When you’re test-driving, you can make assertions about when this inline image updates to test Flash behavior. The image is binary, so it’s hard to make assertions about exactly what has changed.. but it’s a start.
When you specify a gem from a custom source, and it has dependencies on a separate source, you need to list both sources in geminstaller.yml.
This comes up when you are installing a gem from github and that gem depends on other gems from rubyforge. You can specify multiple sources by adding more –source attributes.