Ruby On Rails ActiveRecord Query Interface - Run With Code

Latest

Learn Ruby On Rails , Linux and IoT(Internet Of Things).

Amazon

Tuesday 3 March 2020

Ruby On Rails ActiveRecord Query Interface

Introduction


ActiveRecord is the M in MVC which is the layer of the system responsible for representing business data and logic. The technique that connects the rich objects of an application to tables in a relational database management system is Object Relational Mapper(ORM).
Active Record will perform queries on the database for you and is compatible with most database systems, including MySQL, MariaDB, PostgreSQL, and SQLite. Regardless of which database system you're using, the Active Record method format will always be the same. According to the Rails Guide.

 ActiveRecord Query Interface Related Examples:

List of Methods to Retrieving Objects from the Database.
    1. delete_all
    2. distinct
    3. find & find_by
    4. group and count
    5. where
    6. where with an array
    7. ActiveRecord Bang (!) methods
    8. ActiveRecord case insensitive search
    9. Get the first and the last record
    10. Includes
    11. Joins




No comments:

Post a Comment

Please do not enter any spam link in the comment box.