module Millstone::ActiveRecord::Extension::ClassMethods::ClassMethods

Public Instance Methods

millstone_column() click to toggle source
# File lib/millstone/active_record/extension.rb, line 60
def millstone_column
  millstone_configuration[:column].to_sym
end
millstone_generate_column_value() click to toggle source
# File lib/millstone/active_record/extension.rb, line 68
def millstone_generate_column_value
  case millstone_type
  when :time then Time.now
  when :boolean then true
  end
end
millstone_only_deleted_conditions() click to toggle source
# File lib/millstone/active_record/extension.rb, line 79
def millstone_only_deleted_conditions
  sanitize_sql(["#{millstone_column_reference} IS NOT ?", nil])
end
millstone_type() click to toggle source
# File lib/millstone/active_record/extension.rb, line 64
def millstone_type
  millstone_configuration[:type].to_sym
end
millstone_without_deleted_conditions() click to toggle source
# File lib/millstone/active_record/extension.rb, line 75
def millstone_without_deleted_conditions
  sanitize_sql(["#{millstone_column_reference} IS ?", nil])
end

Private Instance Methods

relation_with_millstone() click to toggle source
# File lib/millstone/active_record/extension.rb, line 84
def relation_with_millstone
  relation = relation_without_millstone
  relation.extending Millstone::ActiveRecord::RelationMethods
end