Module: TemporalTables::TemporalClass::ClassMethods

Defined in:
lib/temporal_tables/temporal_class.rb

Instance Method Summary collapse

Instance Method Details

#build_temporal_constraint(at_value) ⇒ Object



77
78
79
80
81
# File 'lib/temporal_tables/temporal_class.rb', line 77

def build_temporal_constraint(at_value)
  arel_table[:eff_to].gteq(at_value).and(
    arel_table[:eff_from].lteq(at_value)
  )
end

#orig_classObject



71
72
73
# File 'lib/temporal_tables/temporal_class.rb', line 71

def orig_class
  name.sub(/History$/, '').constantize
end