module Voltron::Encrypt::ActiveRecord::CollectionAssociation

Public Instance Methods

ids_reader() click to toggle source
Calls superclass method
# File lib/voltron/encrypt/active_record/collection_association.rb, line 16
def ids_reader
  if klass.has_encrypted_id?
    if loaded?
      load_target.map(&:to_param)
    else
      scope.map(&:to_param)
    end
  else
    super
  end
end
ids_writer(ids) click to toggle source
Calls superclass method
# File lib/voltron/encrypt/active_record/collection_association.rb, line 6
def ids_writer(ids)
  if klass.has_encrypted_id?
    ids.reject!(&:blank?)
    records = klass.find(ids)
    replace(Array.wrap(records))
  else
    super ids
  end
end