title: Ecto: How to Inject data on changeset, without Model.Callbacks
body: <p>Ecto.Model.Callbacks are now deprecated.</p>
  
  <p>I am trying to achieve the same behavior as <code>before_insert</code> but to no avail! I can't even get anything to trigger <code>IO.puts("hello")</code> inside my <code>changeset/2</code>.</p>
  
  <p>Here's what I have:</p>
  
  <pre><code>def changeset(model, params \\ :empty) do
      IO.puts "HELLO" # never prints
      model
      |&gt; cast(params, @required_fields, @optional_fields)
      |&gt; put_change(:column_name, "hello")
  end
  </code></pre>
  
  <p>Instead of <code>put_change</code>, I've tried subbing <code>change</code>, <code>cast</code>, and practically everything else inside Ecto.Changeset.</p>
  
  <p>I've also tried the non-piping method, just in case:</p>
  
  <pre><code>chset = cast(model, params, @required_fields, @optional_fields)
  put_change(chset, :column_name, "hello")
  </code></pre>
  
  <p>The end-goal is shifting the row's <code>inserted_at</code> for a new value, so a simple <code>default: "hello"</code> on the Schema won't suffice.</p>
  
  <p>Many thanks!</p>