Module: BooleanTimestamp::ClassMethods

Defined in:
lib/boolean_timestamp.rb

Instance Method Summary collapse

Instance Method Details

#boolean_timestamp(method_name, strict: true) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/boolean_timestamp.rb', line 11

def boolean_timestamp(method_name, strict: true)
  method_name = String(method_name)
  column_name = "#{method_name}_at"
  fully_qualified_column_name = "#{table_name}.#{column_name}"

  define_boolean_timestamp_scopes(method_name, fully_qualified_column_name, strict: strict)
  define_boolean_timestamp_accessors(method_name, column_name, strict: strict)
end