Sha256: 1b9c0d0fa1ac249c403a395baa9f52ab06c8869a775690643ac52d6f69d33d80
Contents?: true
Size: 614 Bytes
Versions: 10
Compression:
Stored size: 614 Bytes
Contents
module Neutral module Helpers module ActionViewExtension def voting_for(*args) voteable = args.shift options = args.extract_options!.merge(voter: current_voter) not_voteable(voteable) unless voteable.is_a?(Neutral::Model::ActiveRecordExtension::Voteable) Neutral::VotingBuilder::Builder.new(voteable, options).build end private def not_voteable(voteable) raise Neutral::Errors::InvalidVoteableObject, "#{voteable.inspect} is not a voteable object. Try adding 'neutral' into your object's model class definition." end end end end
Version data entries
10 entries across 10 versions & 1 rubygems