使用Rails和PostgreSQL如何按两个DATETIME列进行分组?
我想根据企业的工作日格式化字符串
例如:周一至周五10:00-22:00,SAT-SUN 10:00 - 18:00
我有这个模型
# == Schema Information
#
# Table name: establishment_open_hours
#
# id :integer not null, primary key
# weekday :string
# opens_at :datetime
# closes_at :datetime
# openable_hours_id :integer
# openable_hours_type :string
# created_at :datetime
# updated_at :datetime
#
class Establishment::OpenHour < ActiveRecord::Base
belongs_to :openable_hours, polymorphic: true
end