Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
1,084
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. class ZohoOrder
  2. include ActiveModel::Model
  3. include ActiveModel::Validations::Callbacks
  4.  
  5. ZohoFields = [
  6. 'ID',
  7. 'Added_Time'
  8. ]
  9.  
  10. def self.converted_zoho_attributes
  11. ZohoFields.map do |attr|
  12. attr.downcase.to_sym
  13. end
  14. end
  15.  
  16. attr_accessor *converted_zoho_attributes
  17.  
  18. def added_time
  19. Time.strptime(super, Time::DATE_FORMATS[:zoho])
  20. end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement