Sha256: c499554769a5ae46cccaf2831d4653c02e458be067b6ca381372cba18471969e

Contents?: true

Size: 490 Bytes

Versions: 5

Compression:

Stored size: 490 Bytes

Contents

module OneAssociation
  def search_terms_set(record)
    return [] unless include_in_search_keywords?
    record.get(name).try(:search_terms) || []
  end
  
  def before_destroy(record)
    if @options['destroy'] == true
      record.get(name).try(:destroy)
    end
  end
  
  def typecast(value, record)
    return default if value.blank?
    associated(value, record)
  end
  
  private
    def clear(store, record)
      unassociate(associated(store, record), store, record)
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yodel-0.0.7 lib/yodel/models/core/associations/counts/one_association.rb
yodel-0.0.4 lib/yodel/models/core/associations/counts/one_association.rb
yodel-0.0.3 lib/yodel/models/core/associations/counts/one_association.rb
yodel-0.0.2 lib/yodel/models/core/associations/counts/one_association.rb
yodel-0.0.1 lib/yodel/models/core/associations/counts/one_association.rb