# Model based in a query

**URL:** <https://www.ruby-forum.com/t/model-based-in-a-query/91813>\
**Category:** Rails\
**Created:** [April 12, 2007, 3:59pm UTC](https://www.ruby-forum.com/t/model-based-in-a-query/91813 "2007-04-12T15:59:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jotape](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c77e96/32.png) [@jotape](https://www.ruby-forum.com/u/jotape)\
**Post date:** [April 12, 2007, 3:59pm UTC](https://www.ruby-forum.com/t/model-based-in-a-query/91813/1 "2007-04-12T15:59:59Z")

</div>

Hi all.

Is there a way to build a model based in a query?

That would be the same as build a model in a view, but the fact is that,  
in mysql, views are very limited, so, I would like to base a model in a  
query, not in a table or view. Is there a way?
