arel_table rails

# Step 1: Import the necessary modules
require 'active_record'
require 'arel'

# Step 2: Define a class that inherits from ActiveRecord::Base
class YourModel < ActiveRecord::Base

# Step 3: Create an instance of Arel::Table for the corresponding database table
table = YourModel.arel_table

# Step 4: Use the created Arel::Table instance to build queries
query = table

# Step 5: Execute the query and retrieve the results
result = YourModel.find_by_sql(query.to_sql)