What does the list think about extending Active Record to use some of the patterns discribed by Martin Fowler and Richard T. Snodgrass. Maybe increasing the list of magic field names, having Acts as Temporal... This could provide the capabilites for a model this temporal tables. class CustomerAddress < ActiveRecord::Base acts_as_temporal :scope => ................ end Reference: http://www.cs.arizona.edu/people/rts/tdbbook.pdf [PDF warnning] http://www.martinfowler.com/ap2/timeNarrative.html
On Friday 26 August 2005 19:19, Leon Leslie wrote:> What does the list think about extending Active Record to use some of > the patterns discribed by Martin Fowler and Richard T. Snodgrass.Have you seen acts_as_versioned? See the thread started on 2005-07-16 by Rick Olson and his code at <http://techno-weenie.net/svn/projects/rails_ext/active_record/acts/versioned.rb> Michael -- Michael Schuerig I am the sum total of the parts mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org I control directly. http://www.schuerig.de/michael/ --Daniel C. Dennett, Elbow Room
On 8/26/05, Michael Schuerig <michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote:> On Friday 26 August 2005 19:19, Leon Leslie wrote: > > What does the list think about extending Active Record to use some of > > the patterns discribed by Martin Fowler and Richard T. Snodgrass. > > Have you seen acts_as_versioned? See the thread started on 2005-07-16 by > Rick Olson and his code at > > <http://techno-weenie.net/svn/projects/rails_ext/active_record/acts/versioned.rb>I''d just like to step in and say that link is way outdated. The current code is in the patch: http://dev.rubyonrails.org/ticket/1974 -- rick http://techno-weenie.net
one more link to add to the collection: runt: An implementation of Fowler''s patterns in Ruby: http://runt.rubyforge.org/ On 8/26/05, Leon Leslie <leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > What does the list think about extending Active Record to use some of > the patterns discribed by Martin Fowler and Richard T. Snodgrass. > > Maybe increasing the list of magic field names, having Acts as Temporal... > > This could provide the capabilites for a model this temporal tables. > > class CustomerAddress < ActiveRecord::Base > acts_as_temporal :scope => ................ > end > > > Reference: > > http://www.cs.arizona.edu/people/rts/tdbbook.pdf [PDF warnning] > http://www.martinfowler.com/ap2/timeNarrative.html > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Thanks guys. This is surely a good start. Something like start_date, end_date fields would be good too.. Then one could ask, what was the address of the customer at a particular time. Rails will retrieve a particular version based on some queries. Regards, Leon Leslie On 8/27/05, scott M <rorpostings-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> one more link to add to the collection: > > runt: An implementation of Fowler''s patterns in Ruby: > > http://runt.rubyforge.org/ > > > > On 8/26/05, Leon Leslie <leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > What does the list think about extending Active Record to use some of > > the patterns discribed by Martin Fowler and Richard T. Snodgrass. > > > > Maybe increasing the list of magic field names, having Acts as Temporal... > > > > This could provide the capabilites for a model this temporal tables. > > > > class CustomerAddress < ActiveRecord::Base > > acts_as_temporal :scope => ................ > > end > > > > > > Reference: > > > > http://www.cs.arizona.edu/people/rts/tdbbook.pdf [PDF > warnning] > > http://www.martinfowler.com/ap2/timeNarrative.html > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- First they laugh at you, then they ignore you, then they fight you. Then you win. -- Mahatma Karamchand Gandhi
On 8/29/05, Leon Leslie <leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks guys. > > This is surely a good start. > > Something like start_date, end_date fields would be good too.. > > Then one could ask, what was the address of the customer at a > particular time. Rails will retrieve a particular version based on > some queries. > > > Regards, > Leon LeslieHow would the start/end dates be set? I didn''t implement something like this because I don''t currently need it. But, feel free to make an update and add the dates. However, there''s no reason why you can''t add a before_save callback to the versioned class: Post.versioned_class.class_eval do before_save :set_start_and_end_dates end It seems like the start date would be the created date of the version, and the end date would be the created date of the next version... I may have to read over that temporal pattern stuff again. -- rick http://techno-weenie.net
I have been working on something like this (start_date, end_date), but it is certainly not integrated enough to brag about. In fact, at the moment, I have to include a module to handle this problem. -Dale On 8/29/05, Leon Leslie <leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Thanks guys. > > This is surely a good start. > > Something like start_date, end_date fields would be good too.. > > Then one could ask, what was the address of the customer at a > particular time. Rails will retrieve a particular version based on > some queries. > > > Regards, > Leon Leslie > > > On 8/27/05, scott M <rorpostings-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > one more link to add to the collection: > > > > runt: An implementation of Fowler''s patterns in Ruby: > > > > http://runt.rubyforge.org/ > > > > > > > > On 8/26/05, Leon Leslie <leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > What does the list think about extending Active Record to use some of > > > the patterns discribed by Martin Fowler and Richard T. Snodgrass. > > > > > > Maybe increasing the list of magic field names, having Acts as > Temporal... > > > > > > This could provide the capabilites for a model this temporal tables. > > > > > > class CustomerAddress < ActiveRecord::Base > > > acts_as_temporal :scope => ................ > > > end > > > > > > > > > Reference: > > > > > > http://www.cs.arizona.edu/people/rts/tdbbook.pdf [PDF > > warnning] > > > http://www.martinfowler.com/ap2/timeNarrative.html > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > First they laugh at you, then they ignore you, then they fight you. > Then you win. > -- Mahatma Karamchand Gandhi > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- All creativity is an extended form of a joke. - Alan Kay _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Have you done any work on this? I''d be interested in getting this going. One of my backpackit items is: * Runt in a DB Drop me an email, if you have any ideas. -Dale On 8/27/05, scott M <rorpostings-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > one more link to add to the collection: > > runt: An implementation of Fowler''s patterns in Ruby: > > http://runt.rubyforge.org/ > > > On 8/26/05, Leon Leslie <leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > What does the list think about extending Active Record to use some of > > the patterns discribed by Martin Fowler and Richard T. Snodgrass. > > > > Maybe increasing the list of magic field names, having Acts as > > Temporal... > > > > This could provide the capabilites for a model this temporal tables. > > > > class CustomerAddress < ActiveRecord::Base > > acts_as_temporal :scope => ................ > > end > > > > > > Reference: > > > > http://www.cs.arizona.edu/people/rts/tdbbook.pdf [PDF warnning] > > http://www.martinfowler.com/ap2/timeNarrative.html > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- All creativity is an extended form of a joke. - Alan Kay _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Rick, I don''t think it is a good idea to put it in a before_save start_date, and end_date are the effective or valid dates of that version of the record not the time it was written to the database(update_at). I can attempt to create a patch but I don''t code as neat as you. Leon On 8/30/05, Dale K. Hawkins <dkhawk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Have you done any work on this? I''d be interested in getting this going. > One of my backpackit items is: > > * Runt in a DB > > Drop me an email, if you have any ideas. > > -Dale > > On 8/27/05, scott M <rorpostings-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > one more link to add to the collection: > > > > runt: An implementation of Fowler''s patterns in Ruby: > > > > http://runt.rubyforge.org/ > > > > > > On 8/26/05, Leon Leslie <leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote: > > > > > > What does the list think about extending Active Record to use some of > > > the patterns discribed by Martin Fowler and Richard T. Snodgrass. > > > > > > Maybe increasing the list of magic field names, having Acts as > > > Temporal... > > > > > > This could provide the capabilites for a model this temporal tables. > > > > > > class CustomerAddress < ActiveRecord::Base > > > acts_as_temporal :scope => ................ > > > end > > > > > > > > > Reference: > > > > > > http://www.cs.arizona.edu/people/rts/tdbbook.pdf [PDF warnning] > > > http://www.martinfowler.com/ap2/timeNarrative.html > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > All creativity is an extended form of a joke. > - Alan Kay > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- First they laugh at you, then they ignore you, then they fight you. Then you win. -- Mahatma Karamchand Gandhi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
couldnt this EASILY be done by just adding support for expired_at / expired_on .. then you can go obj.expire! and it sets the column to the current timestamp. we already have created_at and updated_at. so what is the difference between created_at|on and start_date. and why couldnt updated_at and acts_as_versioned effectively be used as an expiration timestamp. On 9/1/05, Leon Leslie <leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Rick, > > I don''t think it is a good idea to put it in a before_save > > start_date, and end_date are the effective or valid dates of that version of the record not the time it was written to the database(update_at). > > I can attempt to create a patch but I don''t code as neat as you. > > Leon > > > > On 8/30/05, Dale K. Hawkins <dkhawk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Have you done any work on this? I''d be interested in getting this going. One of my backpackit items is: > > > > * Runt in a DB > > > > Drop me an email, if you have any ideas. > > > > -Dale > > > > > > On 8/27/05, scott M < rorpostings-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > one more link to add to the collection: > > > > > > runt: An implementation of Fowler''s patterns in Ruby: > > > > > > http://runt.rubyforge.org/ > > > > > > > > > > > > > > > On 8/26/05, Leon Leslie <leonleslie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote: > > > > What does the list think about extending Active Record to use some of > > > > the patterns discribed by Martin Fowler and Richard T. Snodgrass. > > > > > > > > Maybe increasing the list of magic field names, having Acts as Temporal... > > > > > > > > This could provide the capabilites for a model this temporal tables. > > > > > > > > class CustomerAddress < ActiveRecord::Base > > > > acts_as_temporal :scope => ................ > > > > end > > > > > > > > > > > > Reference: > > > > > > > > http://www.cs.arizona.edu/people/rts/tdbbook.pdf [PDF warnning] > > > > http://www.martinfowler.com/ap2/timeNarrative.html > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > -- > > All creativity is an extended form of a joke. > > - Alan Kay > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > -- > > First they laugh at you, then they ignore you, then they fight you. > Then you win. > -- Mahatma Karamchand Gandhi > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Zachery Hostens <zacheryph-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>