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.