title: How to add an instance method into a model in Phoenix?
body: <p>I have this model:</p>
  
  <pre><code>defmodule MyApp.MyModel do
    use MyApp.Web, :model
    import Ecto.Query
  
    # ....
  </code></pre>
  
  <p>How can I add an instance method to it which also uses other field on MyModel? This doesn't work because on an html page it throws an exception saying <code>the key :my_method not found</code> </p>
  
  <pre><code>defmodule MyApp.MyModel do
    use MyApp.Web, :model
    import Ecto.Query
  
    # doesn't work
    def my_method do
      # how can I get access to "this" or "self" from here?
  
      "test"
    end 
  </code></pre>