Skip to content

Instantly share code, notes, and snippets.

@mrpunkin
Created September 9, 2019 18:40
Show Gist options
  • Save mrpunkin/c584c21a1791b460e1a24ea2a4dee0a0 to your computer and use it in GitHub Desktop.
Save mrpunkin/c584c21a1791b460e1a24ea2a4dee0a0 to your computer and use it in GitHub Desktop.
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