Module: HasUuid::ActiveRecord::Associations::Builder::CollectionAssociation::RedefinedWriter

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

Instance Method Summary collapse

Instance Method Details

#define_writers_with_uuid(mixin, name) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/has_uuid/active_record/associations/builder/collection_association.rb', line 52

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

#define_writers_with_uuid_args(mixin, name) ⇒ Object



60
61
62
63
# File 'lib/has_uuid/active_record/associations/builder/collection_association.rb', line 60

def define_writers_with_uuid_args(mixin, name)
  define_writers_without_uuid_args(mixin, name)
  define_writers_with_uuid(mixin, name)
end

#define_writers_with_uuid_no_argsObject



65
66
67
68
# File 'lib/has_uuid/active_record/associations/builder/collection_association.rb', line 65

def define_writers_with_uuid_no_args
  define_writers_without_uuid_no_args
  define_writers_with_uuid(mixin, name)
end