~/talk

Learn to Make an API-Backed Model with

Talkat RailsConf 2019 · 2019-05-01..05-03· [ruby-on-rails]
slides:none on file

Shows how a Rails model can be backed by an external API rather than a database, using ActiveModel::Attributes (Rails 5.2) for typed coercion, the square_connect Ruby SDK to call Square’s Customers API, and standard Rails bits like Pagy for pagination. One include (ActiveModel::Model) brings in five convenience modules; adding ActiveModel::Dirty requires just two method hooks to get change tracking. A Customer model plus controllers and views are implemented and demoed performing fetch, create, update, delete and pagination successfully.

AI-written summary · about

  1. 0:00Introduction
  2. 1:40Active Model
  3. 2:40Attributes API
  4. 3:44Square Customer API
  5. 5:42Square Model Callbacks
  6. 7:29ActiveModelDirty
  7. 9:21ActiveModelDirty Demo
  8. 11:11ActiveModelSerializers
  9. 12:00ActiveModelValidations
  10. 13:09Naming and Translation
  11. 14:08Lint Test
  12. 15:09Pretty Print Inspect
  13. 19:39Inspect Object ID
  14. 21:02Inspect Class
  15. 21:38Demo
  16. 27:30Questions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.