Okay, you might encounter a need to put very simple search for active record / model in your Rails app and here is it. Put this code in your active record model: