Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

STI derived class needs self.record_timestamps = true

#1949

i am using 2.1.2 for now and i needed to add self.record_timestamps = true to the derived class.

The statement base.record_timestamps = true within ActiveRecord::Timestamp seems to be visible within the base class only.

class Foo < ActiveRecord::Base

STI Base Model class with timestamns

end

class Bar < Foo

STI Derived class

self.record_timestamps = true # will not work without this end

If this is a wontfix or it is fixed already excuse the noise..

Reported by Paul · February 12th, 2009 @ 10:06 AM

State: invalid
Milestone: 2.x
Assigned to: Ryan Bigg Ryan Bigg
Importance: none

Activity

  1. Akshay Surve
    Akshay Surve

    Paul,

    I was facing a similar problem which you described above with my STI derived classes from a particular base class and so I stumbled upon this ticket. Although, timestamps in STI derived classes from a different base class were working fine.

    So upon further investigation I found out that this was due to the AASM plugin. Removing it everything worked fine. Later I found the following probable patch for the issue with AASM.

    http://github.com/rubyist/aasm/c...

    Hope this helps.

    Cheers!

    March 28th, 2009 @ 12:14 AM

  2. Paul
    Paul

    Great Akshay!

    yes - i am using aasm too. Although i stopped using STI for now within this project (in fact a solution with a simple flag was sufficient) i appreciate your input very much and i am prepared now to give it a second try :)

    Best paul

    March 28th, 2009 @ 03:51 PM

  3. Rishav Rastogi
    Rishav Rastogi
    • Assigned user set to Ryan Bigg

    Problem with aasm and seems have to been fixed overtime. Invalid

    April 11th, 2010 @ 12:09 AM

  4. Rishav Rastogi
    Rishav Rastogi

    Its not a rails bug, i mean

    April 11th, 2010 @ 12:10 AM

  5. Ryan Bigg
    Ryan Bigg
    • State changed from new to invalid

    Not a rails bug.

    April 11th, 2010 @ 12:11 AM

  6. bingbing