this commit in 1.4.0 introduced a bug when extending an already extended record again
Given we have these models:
class Note < ActiveRecord
end
class Note
class Form < ActiveType::Record[Note]
attribute :some_attribute
end
end
class Note
class SuperSpecialForm < ActiveType::Record[Form]
attribute :some_special_attribute
end
end
Then my tests for Note::SuperSpecialForm will break, because Rails cannot resolve the model_name properly
$ Note.model_name.singular_route_key
=> "note"
$ Note::Form.model_name.singular_route_key
=> "note" # level 1 is correct
$ Note::SuperSpecialForm.model_name.singular_route_key
=> "note_form" # this is not correct
I already figured out, that it comes from the deeper hierarchy (extension of a extension of a record) and this piece of code from the commit above:
Hi,
this commit in 1.4.0 introduced a bug when extending an already extended record again
Given we have these models:
Then my tests for
Note::SuperSpecialForm
will break, because Rails cannot resolve themodel_name
properlyI already figured out, that it comes from the deeper hierarchy (extension of a extension of a record) and this piece of code from the commit above:
but I couldn't solve the problem.
Maybe we have to climb via
extended_record_base_class
until we reach a "normal" record (noActiveType::Record
!)