Ticket #16 (reopened task)
ActiveRecord->save_association() should use is_subclass_of(), not get_parent_class()
| Reported by: | Alderete | Owned by: | anonymous |
|---|---|---|---|
| Priority: | lowest | Milestone: | |
| Component: | Action View | Version: | 0.11.0 |
| Severity: | trivial | Keywords: | |
| Cc: |
Description
In order to allow intermediate subclasses of ActiveRecord?, I propose that the save_association() method use is_subclass_of() instead of get_parent_class() to determine if the object is an ActiveRecord? and should be saved to the database.
Specifically, change line 1420 of active_record.php:
- if(is_object($object) && get_parent_class($object) == __CLASS__ && $type) {
+ if(is_object($object) && is_subclass_of($object, __CLASS__) && $type) {
Although normal usage of PHP on Trax does not require creating a subclass of ActiveRecord?, it is important for using ActiveRecord? in stand-alone mode. And it should make no difference to normal usage in Trax.
Change History
Note: See
TracTickets for help on using
tickets.
