I hereby claim:
- I am ivor on github.
- I am apie (https://keybase.io/apie) on keybase.
- I have a public key whose fingerprint is B7FA B217 D013 B7FA 2522 717E 002B A714 C868 DAB5
To claim this, I am signing this object:
HSTORE PROBLEMS: | |
If the specs are not running because you are running into hstore issues: | |
1. In the postgresql console: | |
update pg_database set datallowconn = TRUE where datname = 'template0'; | |
This allows you to edit your postgresql default database template. | |
2. In your shell: |
#If you get this issue when trying to save to a recently imported postgres db. | |
#PG::Error: ERROR: duplicate key value violates unique constraint | |
#Run the following in your rails console. | |
ActiveRecord::Base.connection.tables.each do |t| | |
ActiveRecord::Base.connection.reset_pk_sequence!(t) | |
end;nil |
Stil, broers, | |
daar gaan 'n man verby, | |
hy groet, | |
en dis verlaas. | |
Daar's nog maar één soos hy; | |
bekyk hom goed. | |
Die oog, | |
nou dof en weggesink, | |
soos vuurvonk kon hy blink - |
I hereby claim:
To claim this, I am signing this object:
defmodule VetMapper.Branch do | |
use VetMapper.Web, :model | |
schema "branches" do | |
field :name, :string | |
field :country, :string | |
field :state, :string | |
field :city, :string | |
field :street_name, :string | |
field :street_number, :integer |
defmodule VetMapper.Repo.Migrations.BranchesStreetAddressUniqueConstraint do | |
use Ecto.Migration | |
def up do | |
create unique_index(:branches, [:country, :state, :city, :street_name, :street_number], name: :index_branches_on_address) | |
end | |
def down do | |
drop index(:branches, [:country, :state, :city, :street_name, :street_number], name: :index_branches_on_address) | |
end |
defmodule DeepMap do | |
def deep_to_map(%DateTime{} = struct), do: DateTime.to_iso8601(struct) | |
def deep_to_map(%Date{} = struct), do: Date.to_iso8601(struct) | |
def deep_to_map(%NaiveDateTime{} = struct), do: NaiveDateTime.to_iso8601(struct) | |
def deep_to_map(%_{} = struct) do | |
struct | |
|> Map.from_struct() | |
|> deep_to_map() | |
end |