# id integer
# opened_at timestamp
# closed_at timestamp
class Ticket < ActiveRecord::Base
def self.with_calendar_duration
select("tickets.*, (closed_at - opened_at) as duration")
end
end
Developer, Rabble-Rouser
Ruby/Scala Developer, PyLadies Boston Founder, Rabble-rouser
# id integer
# opened_at timestamp
# closed_at timestamp
class Ticket < ActiveRecord::Base
def self.with_calendar_duration
select("tickets.*, (closed_at - opened_at) as duration")
end
end