Skip to content

Commit

Permalink
chore: rails 7.1 warning (#2963)
Browse files Browse the repository at this point in the history
Co-authored-by: Adrian Marin <[email protected]>
  • Loading branch information
Paul-Bob and adrianthedev authored Jul 10, 2024
1 parent eb0260d commit 77c4000
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/avo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def boot
# Runs on each request
def init
Avo::Current.error_manager = Avo::ErrorManager.build
check_rails_version_issues
Avo::Current.resource_manager = Avo::Resources::ResourceManager.build
Avo::Current.tool_manager = Avo::Tools::ToolManager.build

Expand Down Expand Up @@ -142,6 +143,21 @@ def extra_gems
def eager_load_actions
Rails.autoloaders.main.eager_load_namespace(Avo::Actions) if defined?(Avo::Actions)
end

def check_rails_version_issues
if Rails.version.start_with?("7.1") && Avo.configuration.license.in?(["pro", "advanced"])
Avo.error_manager.add({
url: "https://docs.avohq.io/3.0/upgrade.html#upgrade-from-3-7-4-to-3-9-1",
target: "_blank",
message: "Due to a Rails 7.1 bug the following features won't work:\n\r
- Dashboards\n\r
- Ordering\n\r
- Dynamic filters\n\r
We recommend you upgrade to Rails 7.2\n\r
Click banner for more information."
})
end
end
end
end

Expand Down

0 comments on commit 77c4000

Please sign in to comment.