Method: OneTouch::ActiveRecordExtension::ClassMethods#as_favorable
- Defined in:
- lib/one_touch/models/active_record_extension.rb
#as_favorable(opt = {}) ⇒ Object
Used in favorable class, so self is a class
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/one_touch/models/active_record_extension.rb', line 94 def as_favorable(opt={}) include ::OneTouch::PortBuild opt.reverse_merge!(bridge_klass: "Favor", no_default_relations: false, portname: :favorable) append_relation(opt) # assign_cattr_in_favor_class(:favorable_klasses,opt) unless opt[:no_default_relations] has_many :be_favors, :class_name => opt[:bridge_klass], :as => :favorable end include AsFavorable include HostRelation if favor_class.respond_to? :include_host_relation_module and favor_class.include_host_relation_module = true end |