Skip to content

Instantly share code, notes, and snippets.

@MarbilleJuntado
Created August 3, 2018 16:18
Show Gist options
  • Save MarbilleJuntado/91674b1352461fc176d7ae9c11415757 to your computer and use it in GitHub Desktop.
Save MarbilleJuntado/91674b1352461fc176d7ae9c11415757 to your computer and use it in GitHub Desktop.
Phoenix protocol error
Protocol.UndefinedError at GET /adaptives/35/invoices/3
protocol Enumerable not implemented for %Enterprise.Billing.Invoice{__meta__: #Ecto.Schema.Metadata<:loaded, "invoices">,
amount: #Decimal<0>, billing_details: %Enterprise.Billing.UserDetail{company_address: nil, company_name: nil,
contact_number: nil, email: nil, id: "60ba6a57-5ac3-499c-b581-cb4d984a05ad", location: nil, name: "Adaptive", vat: nil},
consultant_details: %Enterprise.Billing.UserDetail{company_address: nil, company_name: nil,
contact_number: "11123", email: "carly@gmail.com", id: "bf1c3aad-d363-45f3-83da-6e55fcc90d27", location: nil,
name: "Carly RaeJepsen", vat: nil}, description: "Invoice for 7 2018", due_date: ~D[2018-08-01], end_date: ~D[2018-07-31],
hidden: false, id: 3, inserted_at: #DateTime<2018-08-03 12:58:09.271941Z>, invoice_items: [],
project: %Enterprise.Adaptive{project_users: #Ecto.Association.NotLoaded<association :project_users is not loaded>, __meta__: #Ecto.Schema.Metadata<:loaded, "projects">, end_date: ~D[2018-08-09], consultant_feedback: nil, chatrooms: #Ecto.Association.NotLoaded<association :chatrooms is not loaded>, adaptive_score_params: nil, consultant_rate_type: "per_day", notice_period: nil, client_contact: #Ecto.Association.NotLoaded<association :client_contact is not loaded>, consultant_rate_min: #Decimal<0.0>, notes: #Ecto.Association.NotLoaded<association :notes is not loaded>, name: "Cool Assignment", client_contact_id: 35, extension_end_date: nil, consultant_id: 39, activities: #Ecto.Association.NotLoaded<association :activities is not loaded>, time_sheets: #Ecto.Association.NotLoaded<association :time_sheets is not loaded>, role_description: nil, files: #Ecto.Association.NotLoaded<association :files is not loaded>, extension_start_date: nil, updated_at: #DateTime<2018-08-03 12:58:09.136221Z>, time_entries: #Ecto.Association.NotLoaded<association :time_entries is not loaded>, ebilling_number: nil, extension_consultant_rate_type: "per_day", id: 35, provider: #Ecto.Association.NotLoaded<association :provider is not loaded>, adaptive_score: #Decimal<0.0>, reason_for_cancel: nil, users: #Ecto.Association.NotLoaded<association :users is not loaded>, tasks: #Ecto.Association.NotLoaded<association :tasks is not loaded>, reference_id: nil, external_reference_id: nil, client_rate_type: "per_day", client_feedback: nil, extension_consultant_rate: nil, owned_activities: #Ecto.Association.NotLoaded<association :owned_activities is not loaded>, consultant_rate: #Decimal<5>, user: #Ecto.Association.NotLoaded<association :user is not loaded>, ...}, project_id: 35, reference_id: "201800002", remarks: nil, start_date: ~D[2018-07-01], status: "drafting", team: #Ecto.Association.NotLoaded<association :team is not loaded>, team_id: 1, time_sheets: [], title: "Invoice for 7 2018", updated_at: #DateTime<2018-08-03 12:58:09.271947Z>, user: %Enterprise.User{project_users: #Ecto.Association.NotLoaded<association :project_users is not loaded>, birthday: nil, is_active: false, __meta__: #Ecto.Schema.Metadata<:loaded, "users">, sign_in_count: 0, contracts: #Ecto.Association.NotLoaded<association :contracts is not loaded>, locked_at: nil, uploaded_files: #Ecto.Association.NotLoaded<association :uploaded_files is not loaded>, notifications: #Ecto.Association.NotLoaded<association :notifications is not loaded>, invited_by: #Ecto.Association.NotLoaded<association :invited_by is not loaded>, task_users: #Ecto.Association.NotLoaded<association :task_users is not loaded>, contact_number: "11123", contact_notes: #Ecto.Association.NotLoaded<association :contact_notes is not loaded>, current_sign_in_at: nil, client_position: nil, uid: nil, reminders: #Ecto.Association.NotLoaded<association :reminders is not loaded>, contract_comments: #Ecto.Association.NotLoaded<association :contract_comments is not loaded>, avatar: nil, subscriptions_users: #Ecto.Association.NotLoaded<association :subscriptions_users is not loaded>, position: "consultant", notes: #Ecto.Association.NotLoaded<association :notes is not loaded>, reset_password_sent_at: nil, last_sign_in_at: nil, first_name: "Carly Rae", sessions: #Ecto.Association.NotLoaded<association :sessions is not loaded>, subscriptions: #Ecto.Association.NotLoaded<association :subscriptions is not loaded>, ...}, user_id: 39}. This protocol is implemented for: DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, List, Map, MapSet, Postgrex.Stream, Range, Stream, Timex.Interval
@MarbilleJuntado
Copy link
Author

Stacktrace:

   (elixir) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir) lib/enum.ex:141: Enumerable.reduce/3
    (elixir) lib/enum.ex:1911: Enum.reduce/3
    (enterprise) web/router.ex:1: Enterprise.Router.Helpers.segments/3
    (enterprise) web/router.ex:1: Enterprise.Router.Helpers.api_invoice_path/4
    (enterprise) web/templates/adaptive/invoice/show.html.pug:109: Enterprise.Adaptive.InvoiceView."show.html"/1
    (enterprise) web/templates/layout/app.html.pug:39: Enterprise.LayoutView."app.html"/1
    (phoenix) lib/phoenix/view.ex:332: Phoenix.View.render_to_iodata/3
    (phoenix) lib/phoenix/controller.ex:740: Phoenix.Controller.do_render/4
    (enterprise) web/controllers/adaptive/invoice_controller.ex:1: Enterprise.Adaptive.InvoiceController.action/2
    (enterprise) web/controllers/adaptive/invoice_controller.ex:1: Enterprise.Adaptive.InvoiceController.phoenix_controller_pipeline/2
    (enterprise) lib/enterprise/endpoint.ex:1: Enterprise.Endpoint.instrument/4
    (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
    (enterprise) lib/plug/error_handler.ex:64: Enterprise.Router.call/2
    (enterprise) lib/enterprise/endpoint.ex:1: Enterprise.Endpoint.plug_builder_call/2
    (enterprise) lib/plug/debugger.ex:102: Enterprise.Endpoint."call (overridable 3)"/2
    (enterprise) lib/enterprise/endpoint.ex:1: Enterprise.Endpoint.call/2
    (plug) lib/plug/adapters/cowboy/handler.ex:16: Plug.Adapters.Cowboy.Handler.upgrade/4
    (cowboy) /home/marbille/enterprise/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment