Module: HasUuid::ActiveRecord::Associations::Builder::CollectionAssociation::RedefinedReader

Defined in:
lib/has_uuid/active_record/associations/builder/collection_association.rb

Instance Method Summary collapse

Instance Method Details

#define_readers_with_uuid(mixin, name) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/has_uuid/active_record/associations/builder/collection_association.rb', line 32

def define_readers_with_uuid(mixin, name)
  mixin.class_eval <<-CODE, __FILE__, __LINE__ + 1
    def #{name.to_s.singularize}_uuids
      association(:#{name}).uuids_reader
    end
  CODE
end

#define_readers_with_uuid_args(mixin, name) ⇒ Object



40
41
42
43
# File 'lib/has_uuid/active_record/associations/builder/collection_association.rb', line 40

def define_readers_with_uuid_args(mixin, name)
  define_readers_without_uuid_args(mixin, name)
  define_readers_with_uuid(mixin, name)
end

#define_readers_with_uuid_no_argsObject



45
46
47
48
# File 'lib/has_uuid/active_record/associations/builder/collection_association.rb', line 45

def define_readers_with_uuid_no_args
  define_readers_without_uuid_no_args
  define_readers_with_uuid(mixin, name)
end