mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Speed up i18n-code
This commit is contained in:
parent
1cca1b24d6
commit
739d40af84
1 changed files with 3 additions and 1 deletions
|
@ -46,8 +46,10 @@ module AASM
|
||||||
end
|
end
|
||||||
|
|
||||||
def ancestors_list(klass)
|
def ancestors_list(klass)
|
||||||
|
has_active_record_base = defined?(::ActiveRecord::Base)
|
||||||
klass.ancestors.select do |ancestor|
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue