replace(record) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/associations/belongs_to_association.rb, line 19
      def replace(record)
        if record
          raise_on_type_mismatch!(record)
          update_counters_on_replace(record)
          set_inverse_instance(record)
          @updated = true
        else
          decrement_counters
        end

        replace_keys(record)

        self.target = record
      end
Register or log in to add new notes.