... | ... | @@ -19,7 +19,7 @@ add_column :courses, :duration, :interval |
|
|
|
|
|
### 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
|
|
|
# Shows when you'll be finishing the course
|
|
|
course.duration.from_now
|
... | ... | |