class AasmHistory::PersistanceDeterminator

Public Class Methods

determine(base) click to toggle source
# File lib/aasm_history/persistance_determinator.rb, line 21
def self.determine base
  new(base).determine
end
new(base) click to toggle source
# File lib/aasm_history/persistance_determinator.rb, line 9
def initialize base
  @base = base
end

Public Instance Methods

determine() click to toggle source
# File lib/aasm_history/persistance_determinator.rb, line 13
def determine
  hierarchy = @base.ancestors.map {|klass| klass.to_s}

  if hierarchy.include?('ActiveRecord::Base')
    :active_record
  end
end