Topic: How to make limit for rows that are included?

Good day,
I was wondering? what's the right way of doing limit for sub rows (that are included via includes)?
a wider explanation :
Database structure:
class Place < ActiveRecord::Base
  has_many :performances
class Performance < ActiveRecord::Base
  belongs_to :place
  has_many :performance_events
class PerformanceEvent < ActiveRecord::Base
  belongs_to :performance

Currently i select this way
    @performances = Place.includes(:performances => :performance_events).where('performance_events.starts_at > ? AND performance_events.starts_at < ? AND places.place_category_id = 468', starts_at_gte, starts_at_lte).shuffle

and in view
- loop = 0
   - @performances.each do |pl|
        - break if loop >= 3
        - loop += 1
places.place_category_id = 468 - neet to select only this category of places...
I understant that's it not done the right way... but could have thought only of this.