Is this your first visit? You may want to subscribe to the feed.

Articles tagged with bug

Fix for acts_as_audited and attr_accessible

The biggest complaint I get about acts_as_audited is finally fixed: if you want to use acts_as_audited on a model that uses attr_accessible, you can set the :protect option to false:

class User < ActiveRecord::Base
  acts_as_audited :protect => false
  attr_accessible :name
end

This will prevent acts_as_audited from using attr_protected, which would cause Active Record to raise an error in combination with attr_accessible.

Get the latest code from GitHub

Update: Timothy N. Jones had a good suggestion to automatically disable attr_protected if attr_accessible has already been called. I updated acts_as_audited, so now you only have to set :protect to false if you are declaring attr_accessible after you call acts_as_audited.

Code: bug Aug 02, 2008 ● updated Oct 14, 2008 0 comments

Safari bug with DLs and floats

I came across a weird Safari bug today and couldn’t find any other mention of it on the interwebs. Here’s the CSS and HTML to reproduce it:

dt {
  width: 200px;
  float: left;
}
dd {
  margin: 0 0 0 200px;
}
dd p {
  float: left;
}
<dl>
  <dt>term</dt>
  <dd>
      <p>p1</p>
      <p>p2</p>
      <p>p3</p>
  </dd>
</dl>

With Float

What’s happening is that safari is adding a right margin to the dd, even though it is explicitly set to 0. Removing either the float: left from the dt, or position: overflow from the dd (which is used to clear the floats) makes the right margin go away. Very odd.

Without Float

My ultimate solution was just to add a div inside the dd that set overflow:hidden to clear the floats.

Solution

Code: bug Jul 25, 2008 ● updated Oct 14, 2008 1 comment

Firefox + Mac + Flash + CSS opacity = peek-a-boo

I came across a fun browser bug this morning that I thought I would share. You can’t have a semi-transparent element cover a Flash animation Firefox on the mac.

I had a popup menu that used CSS opacity to make the menu semi-transparent. It was working fine, but then we threw in a Flash header and the Flash would hide any time you moused over a menu item.

Here are some screenshots that demonstrate the bug. The first is how it looks in Safari, the second demonstrates the bug in Firefox, and the third shows Firefox if I remove the opacity attribute from CSS.

Menu in Safari

Menu in Firefox showing bug

Menu in Firfox

The solution: for now, I’ll just have to live without semi-transparent menus (but they looked so good).

I would venture to guess that this is intentional behavior by Firefox. Since Firefox isn’t a native Cocoa app, it doesn’t have access to all the fancy OS X rendering, so it can’t render transparent elements over elements that it doesn’t have control of (Flash), and it just removes the Flash.

Code: bug Apr 26, 2007 ● updated Apr 26, 2007 12 comments

Subscribe

Browse by Tag