class Spectifly::Sequel::Relationship::HasAndBelongsToMany

Attributes

field_name[RW]
many_to_many_table_name[RW]
table_name[RW]

Public Class Methods

new(name, attributes, related_entity) click to toggle source
# File lib/spectifly/sequel/relationship/has_and_belongs_to_many.rb, line 7
def initialize(name, attributes, related_entity)
  super
  related_table_name = Spectifly::Support.tokenize(ActiveSupport::Inflector.pluralize(related_entity.root))
  @field_name = Spectifly::Support.tokenize(ActiveSupport::Inflector.singularize(@entity.name)) + '_id'
  @table_name = Spectifly::Support.tokenize(ActiveSupport::Inflector.pluralize(@entity.type))
  @many_to_many_table_name = [related_table_name, Spectifly::Support.tokenize(@entity.name)].sort.join('_')
end

Public Instance Methods