Sha256: f8a05ce249b2aa4fdbf0259191fe1259ada9e9cbac3c51211dad4874b442506e

Contents?: true

Size: 553 Bytes

Versions: 30

Compression:

Stored size: 553 Bytes

Contents

module ActiveRecord::Associations::Builder
  class HasOne < SingularAssociation #:nodoc:
    def macro
      :has_one
    end

    def valid_options
      valid = super + [:order, :as]
      valid += [:through, :source, :source_type] if options[:through]
      valid
    end

    def constructable?
      !options[:through]
    end

    def configure_dependency
      super unless options[:through]
    end

    def valid_dependent_options
      [:destroy, :delete, :nullify, :restrict, :restrict_with_error, :restrict_with_exception]
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
activerecord-4.0.13 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.13.rc1 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.11.1 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.12 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.11 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.10 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.10.rc2 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.10.rc1 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.9 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.8 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.7 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.6 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.6.rc3 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.6.rc2 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.6.rc1 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.5 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.4 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.4.rc1 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.3 lib/active_record/associations/builder/has_one.rb
activerecord-4.0.2 lib/active_record/associations/builder/has_one.rb