On Monday, October 23, 2017 at 12:38:00 PM UTC-7, Kaiser Pister wrote:
>
> Sorry for the misunderstanding, I typed my code wrong. This is what I 
> meant:
>
> puts DB[:users].first[:name]     # => Kaiser
>
> When I print the underlying hash, I see all the values! 
>
> User.first[:name]      # => Kaiser
>
> Maybe my misunderstanding is more with Ruby than sequel. It was my 
> understanding that User.first would give me a model I can use with the "." 
> accessor.
>
> If I may ask a follow-up:
>
> What is the correct way of accessing these values from within the model?
>

Assuming "name" is a column in the model's table, then:

  User.first.name

should work.  If it doesn't, it could be that Sequel was not able to 
determine the columns for the model's table.  This is fairly rare these 
days, so if you can provide a self contained example showing the problem 
you are having, I'll look into it.

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