This project is archived and is in readonly mode.
STI derived class needs self.record_timestamps = true
Reported by Paul | February 12th, 2009 @ 10:06 AM | in 2.x
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..
Comments and changes to this ticket
-
Akshay Surve March 28th, 2009 @ 12:14 AM
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!
-
Paul March 28th, 2009 @ 03:51 PM
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
-
Rishav Rastogi April 11th, 2010 @ 12:09 AM
- Assigned user set to Ryan Bigg
Problem with aasm and seems have to been fixed overtime. Invalid
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>