Demodulize relationship record class name

This commit is contained in:
François Pradel 2018-08-23 15:50:35 -07:00 committed by Shishir Kakaraddi
parent 42d9203796
commit 3973b312a7

View File

@ -68,7 +68,7 @@ module FastJsonapi
def id_hash_from_record(record, record_types)
# memoize the record type within the record_types dictionary, then assigning to record_type:
associated_record_type = record_types[record.class] ||= record.class.name.underscore.to_sym
associated_record_type = record_types[record.class] ||= record.class.name.demodulize.underscore.to_sym
id_hash(record.id, associated_record_type)
end