9ca34c5a22
This model is responsible for the 1..n - 1..n relationship between an event and the people that will participate in it.
13 lines
362 B
Ruby
13 lines
362 B
Ruby
module Proposable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
has_one :proposition, as: :proposable
|
|
has_one :proposer, through: :proposition
|
|
|
|
Proposition.defined_enums["status"].keys.each do |status|
|
|
scope status.to_sym, -> { joins(:proposition).where(propositions: {status: Proposition.defined_enums["status"][status]}) }
|
|
end
|
|
end
|
|
end
|