Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Method new on collection does not work #4

Description

@loicboutet

Example :
You have a Post model which has many Comment.

You cannot do in reactive-record
post.comments.new(title: "hello world")
So you have to do
post.comments << Comment.new(title: "hello world")

This patch seem to fix the problem :

module ReactiveRecord
  class Collection
    def new(*args)
      self << klass.new(*args)
    end
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions