Skip to content

Instantly share code, notes, and snippets.

require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@ekumachidi
ekumachidi / list_models.rb
Created February 17, 2020 17:23
List all classes in your rails app
Rails.application.eager_load!
ActiveRecord::Base.descendants # It returns all models and its attributes.
ActiveRecord::Base.descendants.collect(&:name) # It returns only the model names
# If you're using > rails 5.0 you can use the line below
ApplicationRecord.descendants.collect(&:name) # It returns only the model names

Keybase proof

I hereby claim:

  • I am ekumachidi on github.
  • I am ekumac (https://keybase.io/ekumac) on keybase.
  • I have a public key ASBf_iD7e-5quNCBlTGzpFVQluFiHNMMWONtc1LJ4eVq3Ao

To claim this, I am signing this object: