Module: Shiftable::ModSignature::PcxMethods

Defined in:
lib/shiftable/mod_signature.rb

Instance Method Summary collapse

Instance Method Details

#shift_data!(shift_to:, shift_from:, bang: false) ⇒ Object

This method could be defined for parity, but it is never used. def has_rel

associations[:has_many]

end



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/shiftable/mod_signature.rb', line 100

def shift_data!(shift_to:, shift_from:, bang: false)
  validate_relationships
  shifting_rel = ShiftingPolymorphicRelation.new(
    to: shift_to,
    from: shift_from,
    column: {
      type: polymorphic_type,
      as: polymorphic_as,
      id_column: shift_pcx_column
    },
    base: base,
    wrapper: wrapper,
    bang: bang
  )
  shifting_rel.shift do
    before_shift&.call(shifting_rel)
  end
end