Skip to content

Instantly share code, notes, and snippets.

@stevegraham
Last active August 29, 2015 14:25
Show Gist options
  • Save stevegraham/b4f43cd761973b073882 to your computer and use it in GitHub Desktop.
Save stevegraham/b4f43cd761973b073882 to your computer and use it in GitHub Desktop.
HStore type
defmodule Knox.Ecto.Hstore do
@behaviour Ecto.Type
def type, do: :hstore
def blank?, do: false
def load(t), do: { :ok, t }
def dump(t), do: { :ok, t }
def cast(t), do: { :ok, t }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment