module Sequel::Plugins::AssociationPks::InstanceMethods

  1. lib/sequel/plugins/association_pks.rb

Methods

Public Instance

  1. after_save
  2. refresh

Public Instance methods

after_save()

After creating an object, if there are any saved association pks, call the related association pks setters.

[show source]
    # File lib/sequel/plugins/association_pks.rb
221 def after_save
222   if assoc_pks = @_association_pks
223     assoc_pks.each do |name, pks|
224      # pks_setter_method is private
225       send(model.association_reflection(name)[:pks_setter_method], pks)
226     end
227     @_association_pks = nil
228   end
229   super
230 end
refresh()

Clear the associated pks if explicitly refreshing.

[show source]
    # File lib/sequel/plugins/association_pks.rb
233 def refresh
234   @_association_pks = nil
235   super
236 end