some code with Active Record Querying