Sha256: 51928b89ae11dae980d11c9f55fd8267e5079522711499276933dc20d2ca27b5
Contents?: true
Size: 531 Bytes
Versions: 6
Compression:
Stored size: 531 Bytes
Contents
module ActiveRecord::Associations::Builder class HasOne < SingularAssociation #:nodoc: def macro :has_one end def valid_options valid = super + [:as] valid += [:through, :source, :source_type] if options[:through] valid end def self.valid_dependent_options [:destroy, :delete, :nullify, :restrict_with_error, :restrict_with_exception] end private def self.add_destroy_callbacks(model, reflection) super unless reflection.options[:through] end end end
Version data entries
6 entries across 6 versions & 1 rubygems