module GlobalUid::HasAndBelongsToManyBuilderExtension

Public Class Methods

included(base) click to toggle source
# File lib/global_uid/has_and_belongs_to_many_builder_extension.rb, line 4
def self.included(base)
  base.class_eval do
    alias_method :through_model_without_inherit_global_uid_disabled_from_lhs, :through_model
    alias_method :through_model, :through_model_with_inherit_global_uid_disabled_from_lhs
  end
end

Public Instance Methods

through_model_with_inherit_global_uid_disabled_from_lhs() click to toggle source
# File lib/global_uid/has_and_belongs_to_many_builder_extension.rb, line 11
def through_model_with_inherit_global_uid_disabled_from_lhs
  model = through_model_without_inherit_global_uid_disabled_from_lhs
  model.disable_global_uid if model.left_reflection.klass.global_uid_disabled
  model
end