Hi,
Should every model have an associated table in database? I have a model
as a subclass of another model class. I am getting ‘MySQL gone away’
error while creating a new object of this subclass.
Any clues?
Amita.
Hi,
Should every model have an associated table in database? I have a model
as a subclass of another model class. I am getting ‘MySQL gone away’
error while creating a new object of this subclass.
Any clues?
Amita.
On May 1, 7:09 am, Amita B. [email protected]
wrote:
Hi,
Should every model have an associated table in database? I have a model
as a subclass of another model class.
not necessarily. For example when using single table inheritance then
a model and its subclasses will share a table, and you can of course
have non-activerecord model classes that don;t use the database at
all.
Fred
I am getting ‘MySQL gone away’
error while creating a new object of this subclass.
Refactor the common code between your tabled and table-less *models into
a
module, and let both models include that module.
*yes, it’s still a model, even if it has no DB persistence.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs