Skip to content

create methods that also create the remote instance #58

@boardfish

Description

@boardfish

One pattern I've been getting into lately is writing a create method on the remote record class and using it to create a reference as follows:

RemoteRecord::Platform::Thing.create(params).yield_self { |r| Platform::ThingReference.create(remote_resource_id: r.remote_resource_id) }

Perhaps it'd be better to have the remote_record DSL define a method that:

  • calls remote_record_class#create, passing authorization if need be
  • uses the response as above to create a new remote reference

That'll allow us to do the above repeatably.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions