Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • T torque-postgresql
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Carlos
  • torque-postgresql
  • Wiki
  • Interval

Interval · Changes

Page history
Updated Interval (markdown) authored Apr 11, 2017 by Lucas Serrano's avatar Lucas Serrano
Show whitespace changes
Inline Side-by-side
Interval.md
View page @ 72fba8b1
...@@ -19,7 +19,7 @@ add_column :courses, :duration, :interval ...@@ -19,7 +19,7 @@ add_column :courses, :duration, :interval
### Using it ### Using it
The column is automatically identified and the value is turn into `ActiveSupport::Duration`. So any of the methods available on it can be used direct from your field. [RubyOnRails Doc](http://api.rubyonrails.org/classes/ActiveSupport/Duration.html) The column is automatically identified and the value is turned into `ActiveSupport::Duration`. So, any of the methods available on it can be used directly from your field. [RubyOnRails Doc](http://api.rubyonrails.org/classes/ActiveSupport/Duration.html)
```ruby ```ruby
# Shows when you'll be finishing the course # Shows when you'll be finishing the course
course.duration.from_now course.duration.from_now
......
Clone repository
  • Arel
  • Auxiliary Statements
  • Belongs to Many
  • Box
  • Circle
  • Configuring
  • Date Time Range
  • Distinct On
  • Dynamic Attributes
  • Enum Set
  • Enum
  • Has Many
  • Home
  • Inherited Tables
  • Insert All
View All Pages