You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.
# stores the correct classhash={'id'=>object.id,'type'=>object.class.name}iffields=definition.send(type)[class_sym].try(:[],:cache)fields.eachdo |field|
raiseErrors::InvalidField.new(field)unlessobject.respond_to?(field)# here it gets overriten by STI "type" fieldhash[field.to_s]=object.send(field)endendwrite_attribute(type,hash)end
Where the type is rewritten by the one from the model's attributes and the load_instance is than throwing an error because it could not find an object based on this type. Note that this only happens if the type column is being cached.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I noticed that if I am using a
type
column in my object and I want to cache it, I run into unexpected problems. I believe the reason lies inactivity.rb
Where the
type
is rewritten by the one from the model's attributes and theload_instance
is than throwing an error because it could not find an object based on thistype
. Note that this only happens if thetype
column is being cached.The text was updated successfully, but these errors were encountered: