Skip to content

Instantly share code, notes, and snippets.

View MarbilleJuntado's full-sized avatar
🏠
Working from home

mjuntado MarbilleJuntado

🏠
Working from home
View GitHub Profile
key :params not found in: %Ecto.Multi{names: #MapSet<[:folder, :params]>,
operations: [params: {:run, #Function<13.60857908/1 in
Enterprise.Contract.Folder.update/3>}, folder: {:changeset, #Ecto.Changeset<action:
:update, changes: %{folder_groups: [#Ecto.Changeset<action: :replace, changes: %{},
errors: [], data: #Enterprise.FolderGroup<>, valid?: true>, #Ecto.Changeset<action:
:insert, changes: %{group_id: 8}, errors: [], data: #Enterprise.FolderGroup<>, valid?:
true>, #Ecto.Changeset<action: :insert, changes: %{group_id: 3}, errors: [], data:
#Enterprise.FolderGroup<>, valid?: true>]}, errors: [], data: #Enterprise.Folder<>,
valid?: true>, []}]}
@MarbilleJuntado
MarbilleJuntado / errors
Created September 15, 2018 15:45
Protocol enumerable error
[error] #PID<0.740.0> running Enterprise.Endpoint terminated
Server: localhost:4000 (http)
Request: GET /contracts/folders/4
** (exit) an exception was raised:
** (Protocol.UndefinedError) protocol Enumerable not implemented for "4". 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
(elixir) lib/enum.ex:1: Enumerable.impl_for!/1
(elixir) lib/enum.ex:141: Enumerable.reduce/3
(elixir) lib/enum.ex:1919: Enum.reduce/3
(enterprise) web/router.ex:1: Enterprise.Router.Helpers.segments/3
(enterprise) web/router.ex:1: Enterprise.Router.Helpers.api_contract_path/3
@MarbilleJuntado
MarbilleJuntado / errors.html
Created August 3, 2018 16:18
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-0
@MarbilleJuntado
MarbilleJuntado / EducationForm.jsx
Created July 23, 2018 04:57
Original Education Form
/* @flow */
import React from 'react'
import isEqual from 'lodash/isEqual'
import validator from 'is-my-json-valid'
import Flatpickr from 'react-flatpickr'
const debounce = require('throttle-debounce/debounce')
@MarbilleJuntado
MarbilleJuntado / EducationForm.jsx
Created July 23, 2018 03:49
Trying to submit a form automatically
/* @flow */
import React from 'react'
import isEqual from 'lodash/isEqual'
import validator from 'is-my-json-valid'
import Flatpickr from 'react-flatpickr'
import Select from 'react-select'
import moment from 'moment'
Prefix Verb URI Pattern Controller#Action
course_reviews GET /courses/:course_id/reviews(.:format) reviews#index
POST /courses/:course_id/reviews(.:format) reviews#create
new_course_review GET /courses/:course_id/reviews/new(.:format) reviews#new
edit_course_review GET /courses/:course_id/reviews/:id/edit(.:format) reviews#edit
course_review GET /courses/:course_id/reviews/:id(.:format) reviews#show
PATCH /courses/:course_id/reviews/:id(.:format) reviews#update
PUT /courses/:course_id/reviews/:id(.:format) reviews#update
DELETE /courses/:course_id/reviews/:id(.:format) reviews#destroy
professor_reviews GET /professors/:professor_id/reviews(.:format) reviews#index
@MarbilleJuntado
MarbilleJuntado / gist:b5f7e73b5e7a40cacf418d86322e91a9
Created June 3, 2018 16:37
Server log when creating new Teacher
Started POST "/teachers" for 127.0.0.1 at 2018-06-04 00:33:46 +0800
Processing by TeachersController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"fBO7yoZknrn4eDaS0lAsDO/faXFAFuotsu8hnsNT+LvGAhP47Yo31eGE+1vkJCcgzQES60jhviEGbcnvUY784g==", "teacher"=>{"name"=>"CS 20", "student_ids"=>["", "1"]}, "commit"=>"Create Teacher"}
User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
↳ app/controllers/teachers_controller.rb:22
Student Load (0.4ms) SELECT "students".* FROM "students" WHERE "students"."id" = ? [["id", 1]]
↳ app/controllers/teachers_controller.rb:22
(0.2ms) begin transaction
↳ app/controllers/teachers_controller.rb:24
(0.1ms) rollback transaction