Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

Active Records for Adding, Removing or Changing a column

When we create a web application we generally create models which are referred to as tables in the database. Sometimes we need to add a column to the existing table or remove an unused column from the table or just change the column. The way to d...

Hash Conditions in Active Records (Rails)

Hash Conditions in Active Records (Rails) Active records allows us to to pass in array conditions to our query to fetch a single record or all the records matching  the key value pair. In these hash conditions we pass the key as the na...

Adding, Removing or Changing a column through Active Records in Rails

While creating a web application we create models in our application which act as tables in the database. Sometimes when the development of the application moves further, the need arises to add a column to our existing table or removing a column ...

Finding or Building a New Object In Rails Through Active Records

Finding or Building a New Object In Rails Through Active Records Active records provide us with some methods which we can use in our database to find or create objects automatically without having to fire two queries. These methods run 2...

Select Vs Pluck in Rails

In this tutorial we will see how we can use pluck and select in rails active record queries.   Select is used to fetch records with specific attributes. It returns ActiveRecord::Relation object.   Project.select(:id) Project...

Transaction in Rails

To maintain the data integrity sometimes we need the changes to database to occur when all of the actions have successfully finished.  One of the examples is funds transfer from one account to another. One account should be debited and anoth...

Active record rails

Earlier when programmer used to build a web application, they required the skills to code in both business logic language and database language. However now, back-end frameworks are using Object-Relational Mapping (ORM). It helps programmer st...

How to Apply Active Record Observer on a Particular Column

Meaning:- Active Record Observers means a callback or a trigger which will get called in the life cycle of active record object. This is used for the purpose of reducing the burden on model's functionality which is not directly belongs to model....
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: