On Saturday, October 21, 2017 at 8:45:51 PM UTC-7, Kaiser Pister wrote:
>
> I must have set up my app incorrectly; any help is appreciated.
>
> I am connecting to my database successfully and can access all my 
> tables/values through the datasets I get from DB[:users].
>
> However when I try to use the model (eg. User.first), the model has nil 
> values for all its attributes.
>
> Is there some connection I am missing?
>
> For more clarity:
>
> puts DB[:users].count              # => 24
> puts DB[:users].first['name']     # => Kaiser
>

This is very odd.  Sequel uses symbols for the hash keys, not strings.  If 
you are using something that uses string keys instead of symbol keys (such 
as an external adapter or extension), then that is what is likely breaking 
Sequel::Model.
 

> puts User.all.count                   # => 24
> puts User.first.name                 # => nil
>

You could do:

p User.first.values

and see what is in the underlying hash.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to