Skip to content

Instantly share code, notes, and snippets.

@msroot
Last active April 27, 2020 17:16
Show Gist options
  • Save msroot/98f108636a39a343ebfd589ef78c65ef to your computer and use it in GitHub Desktop.
Save msroot/98f108636a39a343ebfd589ef78c65ef to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
def self.datetime_attributes
@datetime_attributes ||= columns_hash.select {|k,v| v.type == :datetime}.keys.sort
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment