Votex v0.3.0 Votex.Votable View Source
Defines a Votable Model
A Votable model will expose the required methods to enable voting functionality Typically be used by models like Post, Image, Answer etc.
Example
defmodule Post do
use Ecto.Schema
use Votex.Votable
schema "posts" do
field :title, :string
field :views, :integer, default: 0
end
end
Link to this section Summary
Functions
Reserved for internal use
Clean up votes after a votable record is deleted
Primary method to remove a vote
Primary method to cast a vote
Get a list of votes on votable record
Link to this section Functions
Reserved for internal use