Validations, Scopes, & Callbacks

Ruby on Rails 4.2    |    Intermediate
  • 14 videos | 57m 21s
  • Earns a Badge
Rating 5.0 of 1 users Rating 5.0 of 1 users (1)
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 validation
    Use conditional validation
    Use custom validators in models
    Use custom validators in classes
    Compare using the errors[] with the invalid? method
    Recall what methods do not invoke validations
    Protect against attacks by controlling mass-assignment attributes
  • Recall how to run an unscoped query and why you might need to do so
    Chain scopes with lambdas
    Load all the specified associations with the minimum number of queries
    Use active model
    Use conditional callbacks
    Use transaction callbacks
    Use activerecord to model data

IN THIS COURSE

  • 3m 10s
    During this video, you will learn how to validate your model. FREE ACCESS
  • 2m 8s
    In this video, you will learn how to use conditional validation. FREE ACCESS
  • Locked
    3.  Using Custom Validators in Models
    3m 33s
    In this video, you will learn how to use custom validators in your models. FREE ACCESS
  • Locked
    4.  Using Custom Validators in Classes
    4m 17s
    Find out how to use custom validators in classes. FREE ACCESS
  • Locked
    5.  Working with ActiveRecord Errors
    3m 23s
    During this video, you will learn how to compare using the errors[] method with the invalid? method. FREE ACCESS
  • Locked
    6.  Skipping Validations
    1m 57s
    Upon completion of this video, you will be able to recall what methods do not invoke validations. FREE ACCESS
  • Locked
    7.  Controlling Mass-assignment Attributes
    4m 3s
    In this video, you will learn how to protect against attacks by controlling mass-assignment attributes. FREE ACCESS
  • Locked
    8.  Using Scopes
    4m 23s
    Upon completion of this video, you will be able to recall how to run a query without a scope and why you might need to do so. FREE ACCESS
  • Locked
    9.  Using Scopes with Lambda
    2m 37s
    In this video, find out how to chain scopes with lambdas. FREE ACCESS
  • Locked
    10.  Loading Associated Records of Objects
    3m 47s
    In this video, you will learn how to load all the specified associations with the minimum number of queries. FREE ACCESS
  • Locked
    11.  Using Active Model
    6m 8s
    Learn how to use the active model. FREE ACCESS
  • Locked
    12.  Using Conditional Callbacks
    4m 27s
    In this video, learn how to use conditional callbacks. FREE ACCESS
  • Locked
    13.  Using Transaction Callbacks
    3m 49s
    In this video, you will learn how to use transaction callbacks. FREE ACCESS
  • Locked
    14.  Exercise: Modeling Data with ActiveRecord
    9m 37s
    During this video, you will learn how to use ActiveRecord to model data. FREE ACCESS

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.

YOU MIGHT ALSO LIKE

Rating 3.8 of 11 users Rating 3.8 of 11 users (11)
Course ActiveRecords
Rating 4.0 of 1 users Rating 4.0 of 1 users (1)
Rating 4.4 of 179 users Rating 4.4 of 179 users (179)