Skip to content

Instantly share code, notes, and snippets.

@jessecurry
Created June 11, 2015 13:57
Show Gist options
  • Save jessecurry/7e3a5ed08297d43741ac to your computer and use it in GitHub Desktop.
Save jessecurry/7e3a5ed08297d43741ac to your computer and use it in GitHub Desktop.
Example of GlobalID in a custom class
class ReportBuilder
include GlobalID::Identification
def id
report.id
end
def self.find id
new(report_class.find(id))
end
#############################################################################
def initialize report
@report = report
end
#############################################################################
protected
def self.report_class
Report
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment