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

add a record.load method #97

Open
catmando opened this issue May 11, 2018 · 1 comment
Open

add a record.load method #97

catmando opened this issue May 11, 2018 · 1 comment

Comments

@catmando
Copy link
Contributor

if for some reason you want to insure all attributes are loaded you have to say:

  # trip is some record instance ... 
  Hyperloop::Model.load do 
    trip.attr1
    trip.attr2
    trip.attr3
    trip
  end.then do |trip|
    # everything you asked for in the load is loaded
  end

the problem is that hyperloop currently has no way of knowing which attributes are legal, so the developer has to list the attributes out based on their understanding of the current context/acting user.

Instead this would be nice: trip.load. This would have to be a new server op, as we want to use server-side policies to get the the list of available attributes for the current user, and then return the data.

@mareczek
Copy link

+1
+1
+1
+1
+1
+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants