You cant do it this way, because the self.name.blank? gets evaluated when the class gets evaluated for the first time. So you end up with ":if => false" or ":if => true" or an errors occurs.
before_save :default_name, :if => self.name.blank?
In the same file you have an example of how this can be done:
before_save :default_name, :if => lambda { |entry| entry[:name].blank? }
However there are other options. Check the documentation.