madeintandem / hstore_accessor

Adds typed hstore-backed field support to ActiveRecord models.
MIT License
242 stars 47 forks source link

Inquiry methods #2

Closed leods92 closed 10 years ago

leods92 commented 11 years ago

What about adding inquiry methods (e.g. Car.suv?) for attributes? I think it'd be pretty cool.

After searching for a little while I discovered that Rails' implementation for them is not that simple. For that reason, we should use query_attribute() if we want to do that in hstore_accessor as well.

What do you guys thing about it?

tonycoco commented 11 years ago

Got a pull request? I like that idea. Predicate methods are always useful in app development. /cc @thegrubbsian @jhirn

leods92 commented 11 years ago

Oh! That's how they're called, "predicate methods" :laughing: I haven't code anything yet but I might try something this weekend if nobody does it until then.

tonycoco commented 11 years ago

Sounds good. If not, I'll sketch out the commits later next week.

thegrubbsian commented 10 years ago

This is done now in master, will release a new version shortly.