magnificent-jackal-1244
12/02/2025, 9:46 AMresource = Avo.resource_manager.get_resource_by_model_class(@reflection.active_record.name).new(params: helpers.params, view: view, user: helpers._current_user)
undefined method 'new' for nil
thanks!miniature-optician-85831
12/02/2025, 9:46 AMloud-jewelry-99127
12/02/2025, 9:58 AMNoticed::Notification?magnificent-jackal-1244
12/02/2025, 10:01 AMfield :recipient, as: :belongs_to, polymorphic_as: :recipient, types: [::PortalUser, ::AdminUser]
I've also tried with:
field :recipient, as: :belongs_to, polymorphic_as: :recipient, types: [::User]
Because the relation is polymorphic in the Notification model, but the User is just and STI.loud-jewelry-99127
12/02/2025, 10:01 AMloud-jewelry-99127
12/02/2025, 10:02 AMAvo::Resources::Notification ?magnificent-jackal-1244
12/02/2025, 10:02 AMloud-jewelry-99127
12/02/2025, 10:03 AMuse_resource: "Avo::Resources::Notification" on the field :notifications, as: :has_many fieldmagnificent-jackal-1244
12/02/2025, 10:04 AMfield :notifications, as: :has_many, use_resource: "Avo::Resources::Notification"
It still fails.loud-jewelry-99127
12/02/2025, 10:05 AMmagnificent-jackal-1244
12/02/2025, 10:05 AMundefined method 'new' for nil
resource = Avo.resource_manager.get_resource_by_model_class(@reflection.active_record.name).new(params: helpers.params, view: view, user: helpers._current_user)magnificent-jackal-1244
12/02/2025, 10:11 AMmagnificent-jackal-1244
12/02/2025, 10:12 AMmagnificent-jackal-1244
12/02/2025, 10:13 AMloud-jewelry-99127
12/02/2025, 11:27 AM# config/initializers/avo.rb
Avo.configure do |config|
config.model_resource_mapping = {
'Noticed::Notification': 'Avo::Resources::Notification'
}
endmagnificent-jackal-1244
12/02/2025, 2:42 PMruby
undefined method 'new' for nil
resource = Avo.resource_manager.get_resource_by_model_class(@reflection.active_record.name).new(params: helpers.params, view: view, user: helpers._current_user)loud-jewelry-99127
12/02/2025, 2:42 PMloud-jewelry-99127
12/02/2025, 2:43 PM@reflection.active_record.name?magnificent-jackal-1244
12/02/2025, 2:43 PMmagnificent-jackal-1244
12/02/2025, 2:44 PMloud-jewelry-99127
12/02/2025, 2:44 PMmagnificent-jackal-1244
12/02/2025, 2:44 PMloud-jewelry-99127
12/02/2025, 2:45 PMloud-jewelry-99127
12/02/2025, 2:45 PMloud-jewelry-99127
12/02/2025, 2:45 PMmagnificent-jackal-1244
12/02/2025, 2:45 PMloud-jewelry-99127
12/02/2025, 2:48 PMloud-jewelry-99127
12/02/2025, 2:48 PMloud-jewelry-99127
12/02/2025, 2:49 PMmagnificent-jackal-1244
12/02/2025, 2:49 PMmagnificent-jackal-1244
12/02/2025, 2:50 PMloud-jewelry-99127
12/02/2025, 2:55 PMloud-jewelry-99127
12/02/2025, 2:55 PMloud-jewelry-99127
12/02/2025, 2:55 PMloud-jewelry-99127
12/02/2025, 2:56 PMloud-jewelry-99127
12/02/2025, 2:57 PMloud-jewelry-99127
12/02/2025, 2:57 PMloud-jewelry-99127
12/02/2025, 2:57 PMmagnificent-jackal-1244
12/02/2025, 2:58 PMmagnificent-jackal-1244
12/02/2025, 2:58 PMloud-jewelry-99127
12/02/2025, 2:59 PMmagnificent-jackal-1244
12/03/2025, 12:25 PMloud-jewelry-99127
12/03/2025, 12:26 PMmagnificent-jackal-1244
12/03/2025, 2:04 PMloud-jewelry-99127
12/03/2025, 2:07 PMloud-jewelry-99127
12/03/2025, 2:07 PMmagnificent-jackal-1244
12/03/2025, 2:09 PM