Skip to content

Commit

Permalink
Speed up i18n-code
Browse files Browse the repository at this point in the history
  • Loading branch information
mainameiz authored and Anil Kumar Maurya committed Aug 23, 2020
1 parent 1cca1b2 commit 739d40a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/aasm/localizer.rb
Expand Up @@ -46,8 +46,10 @@ def i18n_klass(klass)
end

def ancestors_list(klass)
has_active_record_base = defined?(::ActiveRecord::Base)
klass.ancestors.select do |ancestor|
ancestor.respond_to?(:model_name) unless ancestor.name == 'ActiveRecord::Base'
not_active_record_base = has_active_record_base ? (ancestor != ::ActiveRecord::Base) : true
ancestor.respond_to?(:model_name) && not_active_record_base
end
end
end
Expand Down

0 comments on commit 739d40a

Please sign in to comment.