October 2009
18 posts
September 2009
15 posts
1 tag
1 tag
Some of us have started to use a rule of thumb of “no chains in controllers”....
– DO THIS.
Dan Croak in testing named scopes
1 tag
1 tag
Learning Advanced Javascript →
Runnable slides by John Resig
via Trivium
2 tags
Maintain Order of SELECT with IN
So you know that ActiveRecord::Base#find can take an array of ids, right?
User.find(1,2,3)
#=> [#<User …>, #<User …>, #<User …>]
Take a look at this though:
User.find(2,1,3).map(&:id)
#=> [1,2,3]
I’ll bet you didn’t expect that. Okay, maybe you did. But I didn’t expect it.
The above query gets transformed into this SQL:
SELECT * FROM users...
2 tags
2 tags
Opacity returns to IE8 →
Yesterday, Microsoft released a post on the IEBlog that had both good and bad news. The good news was that opacity was back. The bad news was that setting opacity in such a way that IE8 would process it as IE8 is now more complicated than ever.
Here’s the result:
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter:...
3 tags