Last active
April 27, 2020 17:16
-
-
Save msroot/98f108636a39a343ebfd589ef78c65ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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