Skip to content

Instantly share code, notes, and snippets.

@beck03076
Last active August 29, 2015 14:20
Show Gist options
  • Save beck03076/5e1d354f71f573905a9f to your computer and use it in GitHub Desktop.
Save beck03076/5e1d354f71f573905a9f to your computer and use it in GitHub Desktop.
class RegistrationReport
def initialize(id)
@id = id
end
def application_details
Registration.find(@id).programmes.map {|i|
[i.course_level_name,i.partner_name, i.partner_type].join("-")
}.join(",\n")
end
end
class Registration < ActiveRecord
def registration_report
@registration_report ||= RegistrationReport.new(id)
end
def method_missing(method_name, *arguments, &block)
if registration_report.respond_to?(method_name)
registration_report.send(method_name)
else
super
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment