Sha256: 8cba87bb90411391648061c24946371ac9119c0de4f96e768e38c1b341574ff3
Contents?: true
Size: 721 Bytes
Versions: 10
Compression:
Stored size: 721 Bytes
Contents
module Neutral module Model module ActiveRecordExtension def neutral include Voteable end def neutral_voter include Voter end module Voteable extend ActiveSupport::Concern included do has_many :votes, as: :voteable, class_name: Neutral::Vote, dependent: :destroy has_one :voting, as: :votingable, class_name: Neutral::Voting, dependent: :destroy has_many :voters, through: :votes, source: :voter end end module Voter extend ActiveSupport::Concern included do has_many :votes_given, class_name: Neutral::Vote, foreign_key: :voter_id end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems