Displaying 2 results from an estimated 2 matches for "pair_id".
Did you mean:
apic_id
2006 Jul 16
4
Calculations across multiple tables
I have a time tracking app where (pseudo-code)
Client has_many Task has_many TimeRecord
TimeRecord
start_at, :datetime
end_at, :datetime
What I''m trying to do (and I have done using find_by_sql in the past) is get
a sum of the timespan given by ended_at - begun_at for each client.
Is it naive to imagine that AR''s calculations will span relations to provide
a grouped
2006 Aug 30
1
Single Table Inheritance with self-referential join
...this:
create_table :stereos, :force => true do |t|
t.column :type, :string
# common attributes
t.column :photo_name, :string
t.column :created_at, :datetime
t.column :updated_at, :datetime
t.column :order_id, :integer
# attributes for type=Photo
t.column :date_taken, :datetime
t.column :pair_id, :integer
# attributes for type=Preview
t.column :authorized_by_id, :integer
t.column :photo1_id, :integer
t.column :photo2_id, :integer
# attributes for type=Final
t.column :photo1_id, :integer
t.column :photo2_id, :integer
end
Now for the hierarchy of model objects:
class Stereo < Active...