Flowdock
method

configure_dependency

Importance_0
v3.2.8 - Show latest stable - 0 notes - Class: HasOne
configure_dependency() private

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/builder/has_one.rb, line 30
      def configure_dependency
        if options[:dependent]
          unless options[:dependent].in?([:destroy, :delete, :nullify, :restrict])
            raise ArgumentError, "The :dependent option expects either :destroy, :delete, "                                   ":nullify or :restrict (#{options[:dependent].inspect})"
          end

          send("define_#{options[:dependent]}_dependency_method")
          model.before_destroy dependency_method_name
        end
      end
Register or log in to add new notes.