Skip to content

Commit c3cda23

Browse files
Use Rails.logger in view component (#5897)
This came about because the view component does not have access to `logger`, which is specified by the controller. Rather than using the suggested `before_render`, I opted to specify `Rails.logger`, which should be available regardless of the context.
1 parent dd2974b commit c3cda23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/components/avo/audited_changes_record_diff/show_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def initialize(gid:, changes:, unchanged:, view:, user:) # rubocop:disable Lint/
1111
global_id = GlobalID.parse(gid)
1212
resource_class = Avo.resource_manager.get_resource_by_model_class(global_id.model_class)
1313
unless resource_class
14-
logger.info "No avo resource class for #{global_id} found"
14+
Rails.logger.info "No avo resource class for #{global_id} found"
1515
return
1616
end
1717

0 commit comments

Comments
 (0)