Skip to content

Instantly share code, notes, and snippets.

@cdesch
Created January 9, 2018 21:36
Show Gist options
  • Save cdesch/8defe0d38b69c7ce905cf534cd6ece0e to your computer and use it in GitHub Desktop.
Save cdesch/8defe0d38b69c7ce905cf534cd6ece0e to your computer and use it in GitHub Desktop.
iex(49)> MyRewards.Merchants.new_merchant_transactions(1,60)
[debug] QUERY OK source="my_rewards_transactions" db=2.6ms decode=0.2ms
SELECT m0."id", m0."amount", m0."type", m0."reference_number", m0."user_id", m0."merchant_id", m0."reward_id", m0."inserted_at", m0."updated_at" FROM "my_rewards_transactions" AS m0 INNER JOIN (SELECT m0."id" AS "id", COUNT(*) OVER (PARTITION BY m0."user_id") AS "count" FROM "my_rewards_transactions" AS m0 WHERE (m0."merchant_id" = $1)) AS s1 ON s1."id" = m0."id" WHERE (s1."count" > 1) [1]
** (Protocol.UndefinedError) protocol Ecto.Queryable not implemented for [%MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 300, currency: :USD}, id: 1, inserted_at: ~N[2017-03-09 16:48:34.514414], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-09 16:48:34.514418], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 4}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1000, currency: :USD}, id: 17, inserted_at: ~N[2017-03-09 16:48:34.550645], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: 1, type: "credit", updated_at: ~N[2017-03-09 16:48:34.550649], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 4}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 400, currency: :USD}, id: 7, inserted_at: ~N[2017-03-09 16:48:34.530421], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-09 16:48:34.530427], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 4}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 200, currency: :USD}, id: 5, inserted_at: ~N[2017-03-09 16:48:34.526619], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-09 16:48:34.526623], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 4}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 600, currency: :USD}, id: 3, inserted_at: ~N[2017-03-09 16:48:34.521305], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-09 16:48:34.521320], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 4}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 700, currency: :USD}, id: 11, inserted_at: ~N[2017-03-09 16:48:34.537094], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-09 16:48:34.537098], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 5}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 200, currency: :USD}, id: 9, inserted_at: ~N[2017-03-09 16:48:34.533835], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-09 16:48:34.533839], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 5}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 200, currency: :USD}, id: 15, inserted_at: ~N[2017-03-09 16:48:34.542182], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-09 16:48:34.542185], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 5}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 300, currency: :USD}, id: 13, inserted_at: ~N[2017-03-09 16:48:34.539659], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-09 16:48:34.539663], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 5}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 111, currency: :USD}, id: 26, inserted_at: ~N[2017-03-14 22:34:19.513957], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-14 22:34:19.513962], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 222, currency: :USD}, id: 25, inserted_at: ~N[2017-03-14 22:32:31.095413], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-14 22:32:31.095419], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1111, currency: :USD}, id: 24, inserted_at: ~N[2017-03-14 22:28:26.669585], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-14 22:28:26.674768], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 111, currency: :USD}, id: 23, inserted_at: ~N[2017-03-13 04:28:21.788372], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-13 04:28:21.810535], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1200, currency: :USD}, id: 21, inserted_at: ~N[2017-03-10 00:44:41.591311], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: 3, type: "credit", updated_at: ~N[2017-03-10 00:44:41.591317], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 11111, currency: :USD}, id: 20, inserted_at: ~N[2017-03-10 00:44:39.426132], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-10 00:44:39.426139], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 111, currency: :USD}, id: 19, inserted_at: ~N[2017-03-10 00:44:31.207288], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-10 00:44:31.207294], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 111, currency: :USD}, id: 31, inserted_at: ~N[2017-03-14 22:43:56.401457], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-14 22:43:56.401463], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 111, currency: :USD}, id: 29, inserted_at: ~N[2017-03-14 22:36:15.722307], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-14 22:36:15.722313], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 111, currency: :USD}, id: 28, inserted_at: ~N[2017-03-14 22:35:40.117787], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-14 22:35:40.117792], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 111, currency: :USD}, id: 27, inserted_at: ~N[2017-03-14 22:34:52.657707], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-14 22:34:52.657712], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 111, currency: :USD}, id: 30, inserted_at: ~N[2017-03-14 22:40:57.251292], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-03-14 22:40:57.251296], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 7}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 123, currency: :USD}, id: 34, inserted_at: ~N[2017-08-09 19:38:59.304847], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-08-09 19:38:59.304853], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 13}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1000, currency: :USD}, id: 33, inserted_at: ~N[2017-04-21 20:28:18.104832], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-04-21 20:28:18.104839], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 13}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 11, currency: :USD}, id: 32, inserted_at: ~N[2017-04-21 20:28:01.812343], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-04-21 20:28:01.812348], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 13}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1000, currency: :USD}, id: 69, inserted_at: ~N[2017-11-12 22:30:03.972531], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: 3, type: "credit", updated_at: ~N[2017-11-12 22:30:03.972537], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 13}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1325, currency: :USD}, id: 43, inserted_at: ~N[2017-10-13 00:56:18.269165], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-10-13 00:56:18.269171], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 510, currency: :USD}, id: 41, inserted_at: ~N[2017-10-12 23:00:39.763174], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-10-12 23:00:39.763180], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 3210, currency: :USD}, id: 40, inserted_at: ~N[2017-10-12 22:58:03.327229], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-10-12 22:58:03.327236], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1515, currency: :USD}, id: 39, inserted_at: ~N[2017-10-12 22:53:44.661560], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-10-12 22:53:44.675755], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1758, currency: :USD}, id: 42, inserted_at: ~N[2017-10-13 00:52:16.256625], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-10-13 00:52:16.256631], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1624, currency: :USD}, id: 68, inserted_at: ~N[2017-10-15 01:46:18.689442], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-10-15 01:46:18.689449], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1000, currency: :USD}, id: 67, inserted_at: ~N[2017-10-15 01:43:51.182017], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: 3, type: "credit", updated_at: ~N[2017-10-15 01:43:51.182023], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 5000, currency: :USD}, id: 66, inserted_at: ~N[2017-10-15 01:43:19.488276], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: 2, type: "credit", updated_at: ~N[2017-10-15 01:43:19.488282], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1000, currency: :USD}, id: 65, inserted_at: ~N[2017-10-15 01:42:05.042592], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: 3, type: "credit", updated_at: ~N[2017-10-15 01:42:05.042600], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 2148, currency: :USD}, id: 64, inserted_at: ~N[2017-10-15 01:41:08.215328], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-10-15 01:41:08.215335], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 919, currency: :USD}, id: 63, inserted_at: ~N[2017-10-15 01:40:25.917117], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-10-15 01:40:25.917123], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1047, currency: :USD}, id: 62, inserted_at: ~N[2017-10-15 01:32:29.861957], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: nil, type: "debit", updated_at: ~N[2017-10-15 01:32:29.861967], user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: 30}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1200, currency: :USD}, id: 61, inserted_at: ~N[2017-10-15 01:31:46.953974], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: 3, type: "credit", updated_at: ~N[2017-10-15 01:31:46.953981], user: #Ecto.Association.NotLoaded<association :user is not loaded>, ...}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1000, currency: :USD}, id: 60, inserted_at: ~N[2017-10-15 01:20:54.560809], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: 1, type: "credit", updated_at: ~N[2017-10-15 01:20:54.560815], ...}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1200, currency: :USD}, id: 59, inserted_at: ~N[2017-10-15 01:13:10.884629], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: 3, type: "credit", ...}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1100, currency: :USD}, id: 58, inserted_at: ~N[2017-10-15 01:05:34.382982], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, reward_id: 2, ...}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1200, currency: :USD}, id: 57, inserted_at: ~N[2017-10-15 00:58:54.834785], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, reward: #Ecto.Association.NotLoaded<association :reward is not loaded>, ...}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1200, currency: :USD}, id: 56, inserted_at: ~N[2017-10-15 00:54:53.569074], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, reference_number: nil, ...}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1100, currency: :USD}, id: 55, inserted_at: ~N[2017-10-15 00:54:08.958999], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, merchant_id: 1, ...}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1200, currency: :USD}, id: 54, inserted_at: ~N[2017-10-15 00:29:19.576398], merchant: #Ecto.Association.NotLoaded<association :merchant is not loaded>, ...}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1100, currency: :USD}, id: 53, inserted_at: ~N[2017-10-15 00:27:12.624984], ...}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{amount: 1200, ...}, id: 52, ...}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, amount: %Money{...}, ...}, %MyRewards.Transaction{__meta__: #Ecto.Schema.Metadata<:loaded, "my_rewards_transactions">, ...}, %MyRewards.Transaction{...}, ...]. This protocol is implemented for: Atom, BitString, Ecto.Query, Ecto.SubQuery, Tuple
(ecto) /Users/cj/elixir_projects/my_rewards_platform/deps/ecto/lib/ecto/queryable.ex:1: Ecto.Queryable.impl_for!/1
(ecto) /Users/cj/elixir_projects/my_rewards_platform/deps/ecto/lib/ecto/queryable.ex:9: Ecto.Queryable.to_query/1
(ecto) lib/ecto/repo/queryable.ex:34: Ecto.Repo.Queryable.all/4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment