8cf7107445
#295 #295 #295 #295 #295 #295 #295 Co-authored-by: miteruzo <miteruzo@naver.com> Reviewed-on: #296
18 lines
337 B
Ruby
18 lines
337 B
Ruby
# frozen_string_literal: true
|
|
|
|
|
|
module TheatreRepr
|
|
BASE = { only: [:id, :name, :opens_at, :closes_at, :created_at, :updated_at],
|
|
include: { created_by_user: { only: [:id, :name] } } }.freeze
|
|
|
|
module_function
|
|
|
|
def base theatre
|
|
theatre.as_json(BASE)
|
|
end
|
|
|
|
def many theatre
|
|
theatre.map { |t| base(t) }
|
|
end
|
|
end
|