Skip to content

Instantly share code, notes, and snippets.

@jah2488
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save jah2488/fccc96141056696bb5fa to your computer and use it in GitHub Desktop.

Select an option

Save jah2488/fccc96141056696bb5fa to your computer and use it in GitHub Desktop.
View the revisions.
def timer_start(picker)
respond_with(time_entry_from_picker(picker))
end
private def time_entry_from_picker(picker)
return picker.time_entires.create unless picker.time_entries.last.running? || picker.time_entries.present?
picker.time_entries.last
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment