lib/has_one_autocreate.rb
# TODO: Move to find_target once we're in front of cache_fu.
Move to find_target once we're in front of cache_fu.
Move to find_target once we ' re in front of cache_fu .
def reload
      value = find_target
      if value
        @target = value
      elsif method = @reflection.send(:autocreate)
        @target = 
          case method
            when true
              create!
            when Symbol, String
              self.send(method)
            when false
            else
          end
      end
      loaded
    end
def reload value = find_target if value @target = value elsif method = @reflection . send ( :autocreate ) @target = case method when true create! when Symbol , String self . send ( method ) when false else end end loaded end
TODO: Move to find_target once we're in front of cache_fu.
TODO : Move to find_target once we ' re in front of cache_fu .
# nop # default # ActiveRecord::Associations::HasOneAssociation.autocreate