@StatelessCode
  @StatelessCode
Stateless Code | Add UUID Support and Generate the Devise User Model @StatelessCode | Uploaded October 2022 | Updated October 2024, 4 hours ago.
After installing and configuring Devise in the previous videos, we now turn our attention to generating the Devise User model that will be used for managing the logic of storing and authenticating users when they take authentication related actions.

We start by generating a migration to enable the pgcrypto extension in PostgreSQL for UUID database keys.

After that we use the Devise model generator to generate our User model. We set up some fixtures and create a reusable helper method to test that all fixtures for the tested model are valid.

Once that is complete, we fix RuboCop offenses and add some comments to our code.

This video covers:
00:00:12 Introduction
00:01:49 Generate migration to enable pgcrypto extension to support UUID keys
00:04:01 Use the devise generator to create the User model
00:04:52 Customize the generated model file and migration with the modules and attributes we will be using
00:07:56 Set up fixtures to be a bit more meaningful and use DEFAULTS
00:09:57 Add method to test_helper that tests that all fixtures are valid for a model
00:12:14 Add fixture test to User model
00:14:43 Run RuboCop, add exclusions, and correct offenses
00:19:33 Add comments to code and classes
00:20:42 Review changes, commit, push, update issue

#ruby #rails7 #rails #rubyonrails #rubygems #codecast #screencast #github #opensource #minitest #TDD #agile #NerdDice #DnD #roleplaying #softwaredevelopment #learntocode #tailwind #postgresql #rubocop #devise #turbo

See other related StatelessCode videos:
- Overview of Authentication Epic and Choosing Devise youtu.be/FbBDmiqRFzI

This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.
Add UUID Support and Generate the Devise User ModelMigrate from SFDX CLI version 7.x to Salesforce CLI version 2.xAdd Code Climate to Project and Allow for Browser Test Driver OptionsInstall Windows Subsystem for Linux 2 (WSL2) and Set Up Remote Development for Visual Studio CodeCodecast: Getting Started with Rails 7 10: Destroy an Article and Get it Working with TurboCreate a RubyGem 94: Fix a Cognitive Complexity Code Smell from Code ClimateConfigure Devise Settings and Add Environment-Specific Rails CredentialsCodecast: Install Rails 6, PostgreSQL 13, MariaDB 10.5Install balenaEtcher on Ubuntu 22.04Inkscape 07: Create a logo for the statelesscode.com WordPress SeriesUpgrade to Devise 4.9 on Rails 7 and Decommission the 4.8 HacksCodecast: Create a RubyGem 56: Refactor roll_ability_scores Specs

Add UUID Support and Generate the Devise User Model @StatelessCode

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER