Sha256: 1d7254d215d23057edce68cacf6fcc23e0b0d899039cb0dc262913344a4610e8
Contents?: true
Size: 817 Bytes
Versions: 1
Compression:
Stored size: 817 Bytes
Contents
require 'ripple/associations/proxy' require 'ripple/validations/associated_validator' module Ripple module Associations module Embedded def initialize(*args) super lazy_load_validates_associated end protected def lazy_load_validates_associated return if @owner.class.validators_on(@reflection.name).any? {|v| Ripple::Validations::AssociatedValidator === v} @owner.class.validates @reflection.name, :associated => true end def assign_references(docs) Array(docs).each do |doc| next unless doc.respond_to?(:_parent_document=) doc._parent_document = owner end end def instantiate_target(*args) doc = super assign_references(doc) doc end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
seomoz-ripple-1.0.0.pre | lib/ripple/associations/embedded.rb |