Created
September 9, 2019 18:40
-
-
Save mrpunkin/c584c21a1791b460e1a24ea2a4dee0a0 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
class ZohoOrder | |
include ActiveModel::Model | |
include ActiveModel::Validations::Callbacks | |
ZohoFields = [ | |
'ID', | |
'Added_Time' | |
] | |
def self.converted_zoho_attributes | |
ZohoFields.map do |attr| | |
attr.downcase.to_sym | |
end | |
end | |
attr_accessor *converted_zoho_attributes | |
def added_time | |
Time.strptime(super, Time::DATE_FORMATS[:zoho]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment