Validations, Scopes, & Callbacks
Ruby on Rails 4.2
| Intermediate
- 14 videos | 57m 21s
- Earns a Badge
In Rails, models are the gateway to the database. Here you'll learn how to perform validations, and work with virtual models including model callbacks.
WHAT YOU WILL LEARN
-
perform model validationuse conditional validationuse custom validators in modelsuse custom validators in classescompare using the errors[] with the invalid? methodrecall what methods do not invoke validationsprotect against attacks by controlling mass-assignment attributes
-
recall how to run an unscoped query and why you might need to do sochain scopes with lambdasload all the specified associations with the minimum number of queriesuse active modeluse conditional callbacksuse transaction callbacksuse ActiveRecord to model data
IN THIS COURSE
-
1.Defining Model Validation3m 10sUP NEXT
-
2.Using Conditional Validation2m 8s
-
3.Using Custom Validators in Models3m 33s
-
4.Using Custom Validators in Classes4m 17s
-
5.Working with ActiveRecord Errors3m 23s
-
6.Skipping Validations1m 57s
-
7.Controlling Mass-assignment Attributes4m 3s
-
8.Using Scopes4m 23s
-
9.Using Scopes with Lambda2m 37s
-
10.Loading Associated Records of Objects3m 47s
-
11.Using Active Model6m 8s
-
12.Using Conditional Callbacks4m 27s
-
13.Using Transaction Callbacks3m 49s
-
14.Exercise: Modeling Data with ActiveRecord9m 37s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.
Digital badges are yours to keep, forever.