Skip to content

Commit

Permalink
improvement: add pattern matching for clarity on ref/1 and ref/2
Browse files Browse the repository at this point in the history
chore: remove debug logger configuration from test
  • Loading branch information
zachdaniel committed May 15, 2024
1 parent 8481873 commit ad0274b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/ash/expr/expr.ex
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ defmodule Ash.Expr do
def arg(name), do: {:_arg, name}

@doc "A template helper for creating a reference"
def ref(name), do: {:_ref, [], name}
def ref(name) when is_atom(name), do: {:_ref, [], name}

@doc "A template helper for creating a reference to a related path"
def ref(path, name), do: {:_ref, path, name}
def ref(path, name) when is_list(path) and is_atom(name), do: {:_ref, path, name}

@doc "A template helper for creating a parent reference"
def parent(expr), do: {:_parent, [], expr}
Expand Down
2 changes: 0 additions & 2 deletions test/actions/atomic_update_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ defmodule Ash.Test.Actions.AtomicUpdateTest do
|> Ash.Changeset.for_create(:create, %{name: "fred", score: 0})
|> Ash.create!()

Logger.configure(level: :debug)

assert Author.increment_score!(author).score == 1
assert Author.increment_score!(author).score == 2
assert Author.increment_score!(author).score == 3
Expand Down

0 comments on commit ad0274b

Please sign in to comment.