Update queries in base.rb and identity.rb to align with ActiveRecord more accurately. Add .idea folder to .gitignore