@@ -774,15 +774,15 @@ defmodule Ecto.Repo do
774
774
775
775
## Examples
776
776
777
- MyRepo.checked_out?
777
+ MyRepo.checked_out?()
778
778
#=> false
779
779
780
780
MyRepo.transact(fn ->
781
- MyRepo.checked_out? #=> true
781
+ MyRepo.checked_out?() #=> true
782
782
end)
783
783
784
784
MyRepo.checkout(fn ->
785
- MyRepo.checked_out? #=> true
785
+ MyRepo.checked_out?() #=> true
786
786
end)
787
787
788
788
"""
@@ -1856,7 +1856,7 @@ defmodule Ecto.Repo do
1856
1856
A typical example is calling `MyRepo.insert/1` with a struct
1857
1857
and acting on the return value:
1858
1858
1859
- case MyRepo.insert %Post{title: "Ecto is great"} do
1859
+ case MyRepo.insert( %Post{title: "Ecto is great"}) do
1860
1860
{:ok, struct} -> # Inserted with success
1861
1861
{:error, changeset} -> # Something went wrong
1862
1862
end
@@ -2055,8 +2055,8 @@ defmodule Ecto.Repo do
2055
2055
## Example
2056
2056
2057
2057
post = MyRepo.get!(Post, 42)
2058
- post = Ecto.Changeset.change post, title: "New title"
2059
- case MyRepo.update post do
2058
+ post = Ecto.Changeset.change( post, title: "New title")
2059
+ case MyRepo.update( post) do
2060
2060
{:ok, struct} -> # Updated with success
2061
2061
{:error, changeset} -> # Something went wrong
2062
2062
end
@@ -2077,7 +2077,7 @@ defmodule Ecto.Repo do
2077
2077
the database. So even if the struct exists, this won't work:
2078
2078
2079
2079
struct = %Post{id: "existing_id", ...}
2080
- MyRepo.insert_or_update changeset
2080
+ MyRepo.insert_or_update( changeset)
2081
2081
# => {:error, changeset} # id already exists
2082
2082
2083
2083
## Options
@@ -2107,7 +2107,7 @@ defmodule Ecto.Repo do
2107
2107
post -> post # Post exists, let's use it
2108
2108
end
2109
2109
|> Post.changeset(changes)
2110
- |> MyRepo.insert_or_update
2110
+ |> MyRepo.insert_or_update()
2111
2111
2112
2112
case result do
2113
2113
{:ok, struct} -> # Inserted or updated with success
@@ -2166,7 +2166,7 @@ defmodule Ecto.Repo do
2166
2166
## Example
2167
2167
2168
2168
post = MyRepo.get!(Post, 42)
2169
- case MyRepo.delete post do
2169
+ case MyRepo.delete( post) do
2170
2170
{:ok, struct} -> # Deleted with success
2171
2171
{:error, changeset} -> # Something went wrong
2172
2172
end
@@ -2514,11 +2514,11 @@ defmodule Ecto.Repo do
2514
2514
2515
2515
## Examples
2516
2516
2517
- MyRepo.in_transaction?
2517
+ MyRepo.in_transaction?()
2518
2518
#=> false
2519
2519
2520
2520
MyRepo.transact(fn ->
2521
- MyRepo.in_transaction? #=> true
2521
+ MyRepo.in_transaction?() #=> true
2522
2522
end)
2523
2523
2524
2524
"""
0 commit comments