# HABTM: at least one coupled user

**URL:** <https://www.ruby-forum.com/t/habtm-at-least-one-coupled-user/111977>\
**Category:** Rails\
**Created:** [August 14, 2007, 12:12am UTC](https://www.ruby-forum.com/t/habtm-at-least-one-coupled-user/111977 "2007-08-14T00:12:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@leonb](https://www.ruby-forum.com/u/leonb)\
**Post date:** [August 14, 2007, 12:12am UTC](https://www.ruby-forum.com/t/habtm-at-least-one-coupled-user/111977/1 "2007-08-14T00:12:35Z")

</div>

Hi all!

I have this “thing”. Let’s say it is a car. And a car belongs to one or  
more users. So there has to be at least one!

How can I add this validation to Rails? I tried to create some extra  
validation. But that sucked big time. You guys have a plugin or some  
rails core code that works?

Thanks in advance!
