Sha256: 033bc1efe98dbfb81b26408547eeb97d5a52e8aebb025133fd01764f9029908c

Contents?: true

Size: 865 Bytes

Versions: 1

Compression:

Stored size: 865 Bytes

Contents

module ActiverecordToPoro
  module MapperExtension

    def association_rule(to: nil,
                         from: to,
                         reverse_to: from,
                         reverse_from: to,
                         converter: nil,
                         is_collection: false,
                         lazy_loading: nil
                        )

      map_collection = (self.dump_result_source.reflections[from] &&
                        self.dump_result_source.reflections[from].collection?) || is_collection

      rule to: to,
           from: from,
           reverse_to: reverse_to,
           reverse_from: reverse_from,
           reverse_lazy_loading: false, #AR doesn't like ToProcDelegator
           object_converter: converter.mapper,
           is_collection: map_collection,
           lazy_loading: lazy_loading

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord_to_poro-0.0.2 lib/activerecord_to_poro/mapper_extension.rb