title: Phoenix framework / Elixir adding Geospatial fields
body: <p>I am trying to add geospatial fields to the phoenix framework with <a href="https://github.com/bryanjos/geo" rel="nofollow noreferrer">https://github.com/bryanjos/geo</a> package. I want to access through Ecto models so I followed the outlined of adding the line:</p>
  
  <pre><code>Postgrex.Types.define(
    MyApp.PostgresTypes,
    [Geo.PostGIS.Extension] ++ 
      Ecto.Adapters.Postgres.extensions(),
    json: Poison)
  </code></pre>
  
  <p>as outlined in the readme file. Problem is that it doesn't specify exactly where to add this so I added it to config/dev.exs</p>
  
  <p>I then added the line:</p>
  
  <pre><code>types: MyApp.PostgresTypes
  </code></pre>
  
  <p>to my dev repo config file <code>config/dev.exs</code> as specified.</p>
  
  <p>I then get the error that <code>Postgrex.Types.define</code> and <code>Ecto.Adapters.Postgres.extensions</code> functions do not exist (as the modules are reportedly unavailable.</p>
  
  <p>I then try to put the following lines in <code>lib/myapp/myapp.ex</code> as I suspect it has something to do with process intialization. </p>
  
  <pre><code>Postgrex.Types.define(
    MyApp.PostgresTypes,
    [Geo.PostGIS.Extension] ++ 
       Ecto.Adapters.Postgres.extensions(),
    json: Poison)
  </code></pre>
  
  <p>However when I add more fields do another migrate with mix ecto.migrate,
  I get an error:</p>
  
  <blockquote>
    <p>function <code>Jobflo.PostgresTypes.find/2</code> is undefined (module <code>Jobflo.PostgresTypes</code> is not available.</p>
  </blockquote>
  
  <p>I don't think it should be this hard and suspect I am making an obvious mistake. Anyone familiar with setting up Geo stuff with Phoenix would be greatly appreciated. 
  Thankyou. </p>