This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ MIX_ENV=prod mix release --env=prod | |
==> Assembling release.. | |
==> Building release travelguardian_server:0.1.0 using environment prod | |
==> Including ERTS 8.1 from /usr/lib/erlang/erts-8.1 | |
==> Packaging release.. | |
{{case_clause, | |
{'EXIT', | |
{function_clause, | |
[{filename,join,[[]],[{file,"filename.erl"},{line,395}]}, | |
{erl_tar,split_filename,4,[{file,"erl_tar.erl"},{line,471}]}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from(r in to_string(transformation.table), where: field(r, ^transformation.id_column) == ^transformation.id) | |
|> Repo.delete_all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def handle_events(transformations, _from, state) do | |
Repo.transaction(fn -> | |
case process_db_transformations(transformations) do | |
{ :error, cs } -> | |
Repo.rollback(cs) | |
resp -> resp | |
end | |
end) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[error] GenServer :db_runner terminating | |
** (DBConnection.ConnectionError) transaction rolling back | |
(db_connection) lib/db_connection.ex:1195: DBConnection.fetch_info/1 | |
(db_connection) lib/db_connection.ex:1012: DBConnection.transaction_meter/3 | |
(db_connection) lib/db_connection.ex:667: DBConnection.transaction/3 | |
(feed_aggregator) lib/feed_aggregator/db_runner.ex:54: TGFeedAggregator.DBRunner.perform_transformation/1 | |
(feed_aggregator) lib/feed_aggregator/db_runner.ex:49: TGFeedAggregator.DBRunner.process_db_transformations/1 | |
(feed_aggregator) lib/feed_aggregator/db_runner.ex:26: anonymous fn/1 in TGFeedAggregator.DBRunner.handle_events/3 | |
(ecto) lib/ecto/adapters/sql.ex:480: anonymous fn/3 in Ecto.Adapters.SQL.do_transaction/3 | |
(db_connection) lib/db_connection.ex:1063: DBConnection.transaction_run/4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import all plugins from `rel/plugins` | |
# They can then be used by adding `plugin MyPlugin` to | |
# either an environment, or release definition, where | |
# `MyPlugin` is the name of the plugin module. | |
Path.join(["rel", "plugins", "*.exs"]) | |
|> Path.wildcard() | |
|> Enum.map(&Code.eval_file(&1)) | |
use Mix.Releases.Config, | |
# This sets the default release built by `mix release` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ MIX_ENV=prod mix release --env=prod | |
==> Assembling release.. | |
==> Building release my_app:0.1.0 using environment dev | |
==> Packaging release.. | |
==> Release successfully built! | |
You can run it in one of the following ways: | |
Interactive: _build/prod/rel/my_app/bin/my_app console | |
Foreground: _build/prod/rel/my_app/bin/my_app foreground | |
Daemon: _build/prod/rel/my_app/bin/my_app start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Models.MyModel do | |
schema "models" do | |
... | |
belongs_to :assoc, Models.Assoc, type: :string, foreign_key: :assoc | |
end | |
end | |
== Compilation error on file lib/core/models/my_model.ex == | |
** (ArgumentError) foreign_key :assoc must be distinct from corresponding association name | |
lib/ecto/schema.ex:1183: Ecto.Schema.__belongs_to__/4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case type do | |
:max -> select(query, [s, w], %{ id: w.id, summary: max(s.reading) }) | |
_ -> select(query, [s, w], %{ id: w.id, summary: avg(s.reading) }) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources "workouts", WorkoutController, only: [:index, :show] do | |
get "sensor_readings/:sensor_identifier", WorkoutController, :sensor_readings | |
end | |
workout_workout_path GET /workouts/:workout_id/sensor_readings/:sensor_identifier Inova.WorkoutController :sensor_readings | |
resources "/workouts", WorkoutController, only: [:index, :show] do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources "workouts", WorkoutController, only: [:index, :show] do | |
get "sensor_readings/:sensor_identifier", WorkoutController, :sensor_readings | |
end |
NewerOlder