class Syncano::ActiveRecord::Association::Base
Base
class for all associations
Public Class Methods
new(source_model, name)
click to toggle source
Constructor for association @param [Class] source_model @param [Symbol] name
# File lib/syncano/active_record/association/base.rb, line 12 def initialize(source_model, name) self.source_model = source_model self.associated_model = name.to_s.classify.constantize self.foreign_key = source_model.name.foreign_key end
Public Instance Methods
belongs_to?()
click to toggle source
Checks if association is belongs_to type @return [FalseClass]
# File lib/syncano/active_record/association/base.rb, line 20 def belongs_to? false end
has_many?()
click to toggle source
Checks if association is has_many type @return [FalseClass]
# File lib/syncano/active_record/association/base.rb, line 32 def has_many? false end
has_one?()
click to toggle source
Checks if association is has_one type @return [FalseClass]
# File lib/syncano/active_record/association/base.rb, line 26 def has_one? false end