Forum: Rails Engines development db connection within several applications (mountable engine)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
bernhard s. (Guest)
on 2012-06-06 11:11
Hi @ all,

we are developing an application consisting of several components. these
components will be connected inside a mountable engine. our component
has to interact with another component and we would like to connect two
of the database tables with a has_many and belongs_to relation.

more details:

lets assume we have only two apps inside this mountable engine:
festivalmanagement and usermanagement

inside the festivalmanagement exist a model ticket and we have the
relation, that each user can have many tickets and each ticket belongs
to one user. the ticket is a model of the festivalmanagement

what we would like to do is getting informations about the user by doing
something like

id =
name =
and so on...

so we want to have a direkt possibility to ask for the attributes of a
user, which is not part of our app.

of course we can do a select statement by using the user id of a ticket
(the user id is part of the database table tickets),
but we thought that there should exist a more beautiful possibility.

is it enough just to add
  has_many tickets
to the user model and
  belongs_to user
to the ticket model?

hope someone can help me.

kind regards
This topic is locked and can not be replied to.