Sha256: 61d51cd8b5be740384b0ad801f0c2aad3c1760404dfd4fa7bfc15bfe1d98e26a
Contents?: true
Size: 901 Bytes
Versions: 13
Compression:
Stored size: 901 Bytes
Contents
module Abstractor module Methods module Models module AbstractorAbstractionSource def self.included(base) base.send :include, SoftDelete # Associations base.send :belongs_to, :abstractor_subject base.send :has_many, :abstractor_suggestion_sources base.send :has_many, :abstractor_abstractions, :through => :abstractor_suggestion_sources base.send :attr_accessible, :abstractor_subject, :abstractor_subject_id, :deleted_at, :from_method end def normalize_from_method_to_sources(about) sources = [] fm = about.send(from_method) if fm.is_a?(String) || fm.nil? sources = [{ source_type: about.class , source_id: about.id , source_method: from_method }] else sources = fm end sources end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems