... | @@ -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
|
... | | ... | |