I have two models for Show and Performance (to show, as in a play or a comedy show). In models, they are connected as follows:
class Show < ActiveRecord::Base has_many :performances, :dependent => :destroy accepts_nested_attributes_for :performances end class Performance < ActiveRecord::Base belongs_to :show end
The Performance model has the name datetime: start_time.
How to define a region in a model that returns all shows with at least one indicator whose: start_time in the future?
Also, how can I define an area that returns all impressions that do not have any characteristics whose: start_time in the future?
scope ruby-on-rails-4 associations has-many
Kevin k
source share