Created
June 22, 2022 13:23
-
-
Save kevindayton/b3fcf34d9aa672e2af50d2e90058c93d to your computer and use it in GitHub Desktop.
RestUser (ARes model)
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 RestUser< ActiveResource::Base | |
self.include_format_in_path = false | |
self.format = :json_with_root | |
ActiveResource::Base.logger = ActiveRecord::Base.logger | |
self.site = "https://dummyapi.io/data/v1" | |
self.collection_name = "user" | |
self.headers['app-id'] = '62a775e08964108a7e6a7ba6' | |
has_many :posts, class_name: :RestPost | |
self.schema = { | |
id: :integer, | |
title: :string, | |
first_name: :string, | |
last_name: :string, | |
picture: :string, | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment