Closed otegami closed 5 months ago
Related: https://github.com/clear-code/redmine_full_text_search/issues/126
CI failed because of the following error.
Error: FullTextSearch::SearchControllerTest::AttachmentTest#test_api: NoMethodError: undefined method `acts_as_event' for FullTextSearch::Target:Class
ref: https://github.com/clear-code/redmine_full_text_search/actions/runs/8164642884/job/22320305058
Redmine::Acts::Event isn't included in ActiveRecord::Base anymore. That's the reason we cannot use Redmine::Acts::Event#acts_as_event.
Redmine::Acts::Event
ActiveRecord::Base
Redmine::Acts::Event#acts_as_event
Before Redmine v5.1, ActiveRecord::Base included Redmine::Acts::Event. And ActiveRecord::Base was a base class.
https://github.com/redmine/redmine/blob/ed7873a4c49d9209c597378dab9a982391093c32/lib/plugins/acts_as_event/init.rb#L4
After Redmine master, ApplicationRecord included Redmine::Acts::Event. And ApplicationRecord was a base class.
ApplicationRecord
https://github.com/redmine/redmine/blob/fb449c77bc76b3bae9b3f0bfe18560b11f00902c/lib/plugins/acts_as_event/init.rb#L22
Change the base class from ActiveRecord::Base to ApplicationRecord.
Related: https://github.com/clear-code/redmine_full_text_search/issues/126
Issue
CI failed because of the following error.
ref: https://github.com/clear-code/redmine_full_text_search/actions/runs/8164642884/job/22320305058
Cause
Redmine::Acts::Event
isn't included inActiveRecord::Base
anymore. That's the reason we cannot useRedmine::Acts::Event#acts_as_event
.Before Redmine v5.1,
ActiveRecord::Base
includedRedmine::Acts::Event
. AndActiveRecord::Base
was a base class.https://github.com/redmine/redmine/blob/ed7873a4c49d9209c597378dab9a982391093c32/lib/plugins/acts_as_event/init.rb#L4
After Redmine master,
ApplicationRecord
includedRedmine::Acts::Event
. AndApplicationRecord
was a base class.https://github.com/redmine/redmine/blob/fb449c77bc76b3bae9b3f0bfe18560b11f00902c/lib/plugins/acts_as_event/init.rb#L22
Solution
Change the base class from ActiveRecord::Base to ApplicationRecord.