ぼざクリタグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
337 B

  1. # frozen_string_literal: true
  2. module TheatreRepr
  3. BASE = { only: [:id, :name, :opens_at, :closes_at, :created_at, :updated_at],
  4. include: { created_by_user: { only: [:id, :name] } } }.freeze
  5. module_function
  6. def base theatre
  7. theatre.as_json(BASE)
  8. end
  9. def many theatre
  10. theatre.map { |t| base(t) }
  11. end
  12. end