Wednesday 15 August 2012

sql - One abstract rails model -


In the Rail / Active Record, are the three Ruby classes possible, two of which come out of a main square, and after that the utensil And two separate tables for pans like ...

  Classroom Tuperware & lt; ActiveRecord :: Base & Class Pot & lt; Tuperware and Class Pan & lt; Tuperware End   

And the advantage would be that I can use the Tupperware.Find () method and some other things without customizing for each different type.

I believe it works with works ??? I've done it myself many times I'm not sure that it will work in a relative database engine ... but you are actually asking a question that you can answer yourself, just do what you said By trying.

[Answer to Op's comment in]:

I'm just saying that you are using a relative db, such as using MySQL or SQL Have a test rail application and your model should properly define your idea. / P>

I have an abstract model in my application. It is working perfectly and find () method works as you want, but I'm working on Moga. So I'm not using ActiveResource and I can not do it to make sure that it will work for you. The only thing you can do is

Here, check out this excerpt from your code:

No comments:

Post a Comment