flapjack / flapjack-diner

Consumer of the Flapjack API
http://flapjack.io/
MIT License
17 stars 10 forks source link

Add find_entities helper method, for easy conversion between name and ID #31

Closed Sarah-E-Greene closed 10 years ago

Sarah-E-Greene commented 10 years ago

This is the function that I'm having to define in each piece of code that uses flapjack diner 1.0.

@ali-graham What are your thoughts on including this into diner before 2.0 comes out?

ghost commented 10 years ago

It is a bit out of scope for flapjack-diner, where all the public methods currently are HTTParty operations; it's a one-liner, so it's not too much to impose on people for external access; also I'm not sure that we gain a lot from encouraging people to use names instead of ids. @jessereynolds ?

Sarah-E-Greene commented 10 years ago

I agree it's a little out of scope - but from what I've seen, everyone is going to need to call this to get IDs out of the system, unless they've already got a prior mapping of names to ids.

also I'm not sure that we gain a lot from encouraging people to use names instead of ids

This wasn't the intention at all - the aim is to be able to get the ID(s) for a given name, so they can then call other methods with the ID.

ghost commented 10 years ago

I guess we should probably be including it, especially as Flapjack may be the only source of truth for entity ids in some use cases. I'm still not sure that baking in one particular translation method from names -> ids makes sense, when people's business rules for doing so may differ...