Skip to content

Instantly share code, notes, and snippets.

@arathunku
Last active February 3, 2016 07:33
Show Gist options
  • Save arathunku/b1f500158e0d7ad2b681 to your computer and use it in GitHub Desktop.
Save arathunku/b1f500158e0d7ad2b681 to your computer and use it in GitHub Desktop.
def self.fetch_by_tracking_code(tracking_code)
  Domain.where(tracking_code: tracking_code).take
end

gives: (no default scopes)

"SELECT  "domains".* FROM "domains" WHERE 
   "tracking_code"."tracking_code" = 'QwZLPnJuSklhucbBJYLjpUifipNSfEic' LIMIT 1):"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment