Last active
August 29, 2015 14:07
-
-
Save cwsaylor/66e19041f6ecaded73bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# USAGE: | |
# gem install rails | |
# gem install attr_encrypted | |
# edit mysql connection parameters | |
# edit attr_encrypted line and update PUT KEY HERE | |
require "rubygems" | |
require "active_record" | |
require "attr_encrypted" | |
ActiveRecord::Base.establish_connection( | |
:adapter => "mysql2", | |
# :host => "db01a.prod.doximity.com", | |
:host => "127.0.0.1", | |
:database => "doximity_dev", | |
:username => "root", | |
:password => "" | |
) | |
module Inbox | |
class Notification < ActiveRecord::Base | |
self.table_name = "inbox_notifications" | |
attr_encrypted :subject, :body, key: "PUT KEY HERE" | |
end | |
class RecruiterMessage < Notification | |
end | |
class ExpertFinderMessage < Notification | |
end | |
class Message < Notification | |
end | |
end | |
m = Inbox::Notification.find(ARGV[0]) | |
puts JSON.generate({ subject: m.subject, body: m.body }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment