This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RelativeTime | |
| MINUTE = 60 | |
| HOUR = 60 * MINUTE | |
| DAY = 24 * HOUR | |
| WEEK = 7 * DAY | |
| MONTH = 4 * WEEK | |
| YEAR = 12 * MONTH | |
| def self.for(date_to, date_from = Time.zone.now, short: false) | |
| diff = (date_from.to_time - date_to.to_time).round |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gem 'rails', github: 'rails/rails' | |
| require 'active_record' | |
| `dropdb bug_1; createdb bug_1` | |
| ActiveRecord::Base.establish_connection( | |
| adapter: 'postgresql', | |
| database: 'bug_1', | |
| host: 'localhost', |
NewerOlder