# Re: Accessing model info

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

<div class="post-metadata">

**Author:** ![Tyler\_MacDonald](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b5ac83/32.png) [@Tyler\_MacDonald](https://www.ruby-forum.com/u/Tyler_MacDonald)\
**Post date:** [March 14, 2007, 9:55pm UTC](https://www.ruby-forum.com/t/re-accessing-model-info/88838/1 "2007-03-14T21:55:17Z")

</div>

Mick [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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?

Add “belongs\_to :event” to your model object… then

subscription\_object.event

Will be your “Event” object for that event.

Cheers,  
Tyler
