-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sequel collection support #188
Labels
Comments
Reading http://stackoverflow.com/questions/9467395/whats-the-difference-between-to-a-and-to-ary-in-activerecord it seems like we need to support both |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to set up an API that uses Sequel. Trying to present a collection throws this error:
NoMethodError: Entities::Event missing attribute
name' on #Sequel::Postgres::Dataset:0x007fe4861eb078`This works with ActiveRecord, but not with Sequel. The check for if an object is a collection is done by checking if the
.to_ary
method exists on an object. This is true for ActiveRecord, but not for Sequel.I've made a small workaround to make it work for now, but I feel this should be part of Grape Entity and not Sequel.
Is there a more reliable way to check if an object is a collection? Such as doing a check on
.to_a
? Or to check if it is somehow Enumerable?Example setup:
The text was updated successfully, but these errors were encountered: