Votex v0.2.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
Primary method to remove a vote
Primary method to cast a vote
Get a list of votes on votable record