The application will pass on various requests to the models and hence the models should be ready to handle them. Let's take a look at what each model's responsibilities will be. We will also see what are the corresponding methods that Sequel provides for our ease.
User model will be taking care of all the actions possible on a user. The responsibilities will be as follows:
We can use the
create method on the
User model. This
create method is defined in
Sequel::Model and we can directly use it by passing the required values:
This method will create a user in the
users table. If you remember, we have added ...