Skip to content
q = from e in Event,
where: fragment("extract(month from ?) = ?", e.start_time, ^month) and fragment("extract(year from ?) = ?", e.start_time, ^year)
[debug] Processing by SogApi.EventController.index/2
Parameters: %{"format" => "json", "month" => "4", "year" => "2015"}
Pipelines: [:api]
{"SELECT e0.\"id\", e0.\"title\", e0.\"description\", e0.\"slug\", e0.\"price\", e0.\"total_spots\", e0.\"start_time\", e0.\"end_time\", e0.\"track\", e0.\"status\", e0.\"banner_image\", e0.\"overview\", e0.\"come_prepared\", e0.\"takeaways\", e0.\"teachers\", e0.\"guest
s\", e0.\"inserted_at\", e0.\"updated_at\", e0.\"location_id\", e0.\"category_id\" FROM \"events\" AS e0 WHERE (extract(month from e0.\"start_time\") = $1 AND extract(year from e0.\"start_time\") = $2)",
["4", "2015"]}
[info] Sent 500 in 73ms
[error] #PID<0.617.0> running SogApi.Endpoint terminated
Server: localhost:4000 (http)
Request: GET /api/v1/events?year=2015&month=4
{
"data": [
{
id: 1,
type: "foo",
relationships: {
"bars": {
data: [
{ id: 2, type: "bar" }
]
{
"data": [
{
id: 1,
type: "foo",
relationships: {
"bars": {
data: [
{ id: 2, type: "bar" }
]
** (UndefinedFunctionError) undefined function: SogApi.Repo.get/1
(sog_api) SogApi.Repo.get(#Ecto.Query<from a in SogApi.Account, where: a.login == "romy329@hotmail.com">)
export default {
name: 'bike-messenger',
initialize: function(registry) {
registry.register('service:bike-messenger', BikeMessenger);
registry.injection('model', 'bikeMessenger', 'service:bike-messenger');
}
};
defmodule A do
def foo do
@bar
end
end
defmodule B do
use A
@bar :baz
end
# forward migration
alter table(:posts) do
rename :new_posts
end
# backward migration logically would equal
alter table(:new_posts) do
rename :posts
end
View challenges.exs
defmodule Challenge do
# Problem 1
def sum(list) do
_sum(list, 0)
end
defp _sum([], total), do: total
defp _sum([head|tail], total), do: _sum(tail, total+head)
# Problem 2
def alt(list1, list2) do
  1. Elixir
    1. History
      1. Erlang
      2. OTP (Open Telecom Platform)
      3. Web servers as a use-case
      4. Rise of multi-core computing
      5. Cheap memory opens door to immutability
      6. The Whats App story
    2. Inception
      1. First failed attempt (Functional + OOP)
Something went wrong with that request. Please try again.