Sha256: 5fae65366f7457b3fb7e94ccf33d1eee516698c42e437fac8317380eeb8df537

Contents?: true

Size: 294 Bytes

Versions: 6

Compression:

Stored size: 294 Bytes

Contents

module Id
  module Model
    class HasMany < Association

      def define
        field = self
        model.send :define_method, name do
          memoize field.name do
            data.fetch(field.key, []).map { |r| field.type.new(r) }
          end
        end
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
id-0.0.6 lib/id/model/has_many.rb
id-0.0.5 lib/id/model/has_many.rb
id-0.0.4 lib/id/model/has_many.rb
id-0.0.3 lib/id/model/has_many.rb
id-0.0.2 lib/id/model/has_many.rb
id-0.0.1 lib/id/model/has_many.rb