Cathy O'Connell's blog
Interesting Things
Check out the CSS History of Image Replacement Compass supports the two modern ones, see here
git co- (toggle between last branch)
Events This Week
Thursday:
Interesting Things
- When you load objects through associations, you should be aware of how the objects are being loaded. If a where statement is used the calls are being translated to SQL and always hitting the database.
example
it "should whatever" do
foo.bars.where(something: true).each { |bar| bar.modify_something }
foo.bars.each { |bar| bar.expect_something_to_be_modified }
end
This will fail as the first call is not only limiting the association but also loading different objects to the second foo.bars collection.
Choosing first on a has_many association is dangerous. There are two 'first' functions a class and an array one. Depending on whether the association is loaded, a different method is called.
example
it "should do something with the first element" do
foo.bars.first.modify_something
foo.bars(:force_load).first
end
- To ensure loading occurs and thus the object is the same on every call, you can provide any value that evaluates to true as part of the association call. Here :force_load symbol, evaluates to true and forces a database load for bars.
Events This Week
Tuesday:
- 12:30- Brownbag
- 6:30- NYC.rb Hackfest
Thursday:
Interesting Things
- Firefox can't alias a font face, unless the alias is the same place as the server.
- Rails 3 includes a method to return all validators on an object eg:
Person.validators => []
Events
- Handstand practice is becoming as important as stretches.
Interesting Things
- Internet Explorer is now below 50% market share.
- VIM turned 20 - Happy Birthday VIM.
- pgpool-II (version 3.2) - load balancer, failover support, replacement for using postgres directly.PGPOOL-II
Ask for Help
"How do I stub the base (super) class of an object using rspec?"
- No answer yet. It was tested by confirming a method that the base method referenced was called. Solution welcome.
Events
- 7:30pm Raise Cache -Lose 20 pounds in 2 hours from 0 to photoshop
Interesting Things
- Weinre - WEb INspector REmote, a debugger for web pages designed to work remotely, nice weblet look. Allows you to debug web pages on phones.
- Check it out (http://phonegap.github.com/weinre/) Thanks Micah
- Moeless
- Those strange looking people, are just moustache-less pivots. Support/join for the cause. Today is Day one.
Ask for Help
- Rails Validates uniqueness allows nils. The database (psql and mysql) allows unlimited nils. *BUG - The app did not allow unlimited nulls. *Cause - The development structure had an allow nil false but the model file had allow nil true. This caused odd behaviour.
EVENTS
TUESDAY
- 7pm Raise Cache - Project Management for Startups
WEDNESDAY
- 6:30pm Node JS
- 7pm Machine Learning
THURSDAY
- 7pm Raise Cache
