# Ruby Assocations

**URL:** <https://www.ruby-forum.com/t/ruby-assocations/187656>\
**Category:** Ruby\
**Created:** [April 27, 2010, 1:49pm UTC](https://www.ruby-forum.com/t/ruby-assocations/187656 "2010-04-27T13:49:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mailtorajuit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed8c4c/32.png) [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Post date:** [April 27, 2010, 1:49pm UTC](https://www.ruby-forum.com/t/ruby-assocations/187656/1 "2010-04-27T13:49:09Z")

</div>

Hi

in my project i have 2 tables logins and sentitems.  
these 2 have 1-many relation ship. The primay key in login table is  
cust\_id and i have defined the relational key other than conventional  
name which is login\_id.

i want to count the no of records in sentitems which have the cust\_id  
equalled

how to do this.

Regards,  
Rajkumar

---

<div class="post-metadata">

**Author:** ![mailtorajuit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed8c4c/32.png) [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Post date:** [April 27, 2010, 2:00pm UTC](https://www.ruby-forum.com/t/ruby-assocations/187656/2 "2010-04-27T14:00:43Z")

</div>

On Tue, Apr 27, 2010 at 1:49 PM, Rajkumar S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
\<Please look for help on the Ruby On Rails ML, this is the Ruby Ain’t  
Rails ML (sigh)  
I am sure you will get appropriate help there.

Cheers  
R.
