Forum: Ruby on Rails DB & AR advise please (diagram inc)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B0be4bfef5a22697a0f44f4fe295aaef?d=identicon&s=25 James Whittaker (aftershock)
on 2006-01-27 17:13
Hi,
 Being new to Rails and Active record could someone please check my
database diagram:

http://spectrais.com//images/0.png


I am building a trouble ticket system for my company. Simply put a
client has many users. Those users can create trouble tickets. Each
trouble ticket can have many journals that track the progress of the
ticket. An employee (of our company) can take ownership of a trouble
ticket to solve the problem.

As you can see from the diagram the employees and users table looks
identical. Is this something that I can acomplish with singe table
inheritance, thus creating a model for employees and one for users?

Also is my Active record text correct in your opinion? I would like to
be able to do things like:

client = Client.find(params[:id])
client.get_all_active_tickets

user = User.find(params[:id])
user.get_all_tickets

ticket = Ticket.find(params[:id])
ticket.get_all_journals
ticket.get_current_employee
ticket.get_status
ticket.get_company_name
ticket.get_company_email

employee = Employee.find("John Smith")
employee.get_all_my_tickets

Any help would be fantastic!

Thanks Aftershock
00b25ade726ce4fb538d3d8cf47a750b?d=identicon&s=25 Harvey Bernstein (Guest)
on 2006-01-27 17:30
(Received via mailing list)
You might want to have a look at this site,
http://www.simpleticket.net/.
Open source ticket system about to be launched this weekend.  I am not
in
any way associated with Architel.
Harvey


On 27/1/06 16:13, "James Whittaker" <jmwhittaker@gmail.com> wrote:

> ticket. An employee (of our company) can take ownership of a trouble
> client.get_all_active_tickets
>
> employee = Employee.find("John Smith")
> employee.get_all_my_tickets
>
> Any help would be fantastic!
>
> Thanks Aftershock
>
>
>


This e-mail has been scanned for all viruses by MessageLabs.
B0be4bfef5a22697a0f44f4fe295aaef?d=identicon&s=25 James Whittaker (aftershock)
on 2006-01-27 17:37
Harvey,

Thanks I have seen the simpleticket blog etc. The system i'm building is
only part of the whole application and it is tailored to what we
require. After this is completed it will be expanded to include client
invoicing (this is currently done by PDF), client kit ordering, employee
timesheets (linked in with the time spent on answering trouble tickets)
etc.

It would be useful to see what simpleticket has but I am very keen to
learn my own way of doing things rather than copy another solution. My
plan is to learn more and more ruby & rails stuff.

Does the diagram look ok? Am I on the right lines?
This topic is locked and can not be replied to.