Sha256: dfbdc58fb2bde1c84b4068b8201a0c9222e5005de684c57f3d83d0d2dcfabc67
Contents?: true
Size: 1.13 KB
Versions: 2
Compression:
Stored size: 1.13 KB
Contents
module Syncify module Association class StandardAssociation attr_accessor :from_class, :to_class, :name, :destination, :traversed def initialize(from_class:, association:, destination:) @from_class = from_class @to_class = association.klass @name = association.name @destination = destination @traversed = false end def polymorphic? false end def traversed? traversed end def inverse_of?(association) if association.polymorphic? association.to_classes.include?(from_class) && association.from_class == to_class else association.to_class == from_class && association.from_class == to_class end end def create_destination(name) destination[name] = {} end def hash "#{self.from_class.to_s}#{self.to_class.to_s}#{self.name}".hash end def eql?(other_association) self.from_class == other_association.from_class && self.to_class == other_association.to_class && self.name == other_association.name end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
syncify-0.1.11 | lib/syncify/association/standard_association.rb |
syncify-0.1.10 | lib/syncify/association/standard_association.rb |