Skip to content

Commit

Permalink
chore: callable disabled_features (#3319)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob authored Oct 9, 2024
1 parent 9a9a4b2 commit 700233e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/avo/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Configuration
attr_accessor :display_license_request_timeout_error
attr_accessor :current_user_resource_name
attr_accessor :raise_error_on_missing_policy
attr_accessor :disabled_features
attr_writer :disabled_features
attr_accessor :buttons_on_form_footers
attr_accessor :main_menu
attr_accessor :profile_menu
Expand Down Expand Up @@ -155,8 +155,12 @@ def root_path
@root_path
end

def disabled_features
Avo::ExecutionContext.new(target: @disabled_features).handle
end

def feature_enabled?(feature)
!@disabled_features.map(&:to_sym).include?(feature.to_sym)
!disabled_features.map(&:to_sym).include?(feature.to_sym)
end

def branding
Expand Down

0 comments on commit 700233e

Please sign in to comment.