-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auditable type in single table inheritance. #227
Comments
you can first fetch the record and then retrieve its name as every record of SIT will have unique id. ChildObject.last.audits.last.auditable.class.name |
@jaswinder97 - I agree with your explanation, but wouldn't this be part of the gem itself? I think @CuriousAnkush (and myself) are asking for the implementation within the gem. If you have a working fork, please post here. |
I have a forked version.Will post it today. On 25 September 2016 at 22:42, Vijay Raghavan Aravamudhan <
Thanks & Regards, |
@jaswinder97 - ping - could you please post the fork version soon? |
@jaswinder97 - can you please post the forked version? I need to get this solved asap - and would really appreciate your help! |
@vijay -Currently I am travelling .Will let you know after reaching my home. On 10 October 2016 at 21:26, Vijay Raghavan Aravamudhan <
Thanks & Regards, |
I believe it's the standard Rails behaviour to only store the parent class name in the type field when using STI with polymorphic associations (like audit's Storing the subclass name in the type field can lead to problems using these associations in some versions of Rails, as it always expects the base class there. |
@jaswinder97 - While it's true that we can join/query the type on the base STI model when we create or update a model, we can't do so after we delete a model. It might be nice to provide a mechanism to remove |
So there's no hope to get a solution like #368 merged? |
Any update on this? In my opinion, identifying the source model should not be dependent on still having access to the record (e.g. after deleting a record) |
I am using single table inheritance in rails, and I am auditing the parent class. Whenever, I create/update the child class/model, auditable type for that audit stores the name of the parent class instead of the name of the child class .
Is this feature of audited is intended, or is it just a side effect of SIT.
What are the ways in which I could know the more specific auditable type in Single table inheritance?
The text was updated successfully, but these errors were encountered: