# Accessing model info

**URL:** <https://www.ruby-forum.com/t/accessing-model-info/88835>\
**Category:** Rails\
**Created:** [March 14, 2007, 9:24pm UTC](https://www.ruby-forum.com/t/accessing-model-info/88835 "2007-03-14T21:24:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@mick](https://www.ruby-forum.com/u/mick)\
**Post date:** [March 14, 2007, 9:24pm UTC](https://www.ruby-forum.com/t/accessing-model-info/88835/1 "2007-03-14T21:24:56Z")

</div>

Hi there,

I have a model called Subscription which contains (and therefore links)  
a user\_id and an event\_id (both User and Event being additional models  
themselves).

When I call Subscription.find(user\_id = 1) for example, it will return a  
hash of all the records therein where user\_id is equal to 1.

How, then, do I access the full details of an event from the event ID’s  
returned?

I hope this makes sense to someone, any help is appreciated!

Cheers

Mick

---

<div class="post-metadata">

**Author:** ![mick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@mick](https://www.ruby-forum.com/u/mick)\
**Post date:** [March 14, 2007, 9:50pm UTC](https://www.ruby-forum.com/t/accessing-model-info/88835/2 "2007-03-14T21:50:16Z")

</div>

Hi,

data = Subscription.find(user\_id = 1)  
p data.attributes # I think this will display every attribute  
connected to that object.

puts “Subscribers lastname: #{data.lastname}”

Not even 50% sure it´ll work, but give it a try! 🙂

Regards,  
Martin S.
