Skip to content

Instantly share code, notes, and snippets.

Created May 1, 2012 08:35
Show Gist options
  • Save anonymous/2566353 to your computer and use it in GitHub Desktop.
Save anonymous/2566353 to your computer and use it in GitHub Desktop.
controller:
format.json {
render json: @ticket, :include => {
:courses_users => {
:include => {
:user => {
:only => [:first_name, :last_name]
},
:course => {
:only => :title
}
}
}
}, :except => [:created_at, :updated_at]
}
Model:
def self.valid?
self.validFrom < Time.now && self.validTo < Time.now
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment