Skip to content

Commit

Permalink
Merge pull request #243 from marco-zanon/master
Browse files Browse the repository at this point in the history
Update Working_With_Genie_Apps.md
  • Loading branch information
essenciary authored Jun 8, 2020
2 parents d75f167 + 16fbb4f commit 3094b1d
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions docs/guides/Working_With_Genie_Apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -708,15 +708,15 @@ Edit the `Books.jl` file to make it look like this:
# Books.jl
module Books
import SearchLight: AbstractModel, DbId
import SearchLight: AbstractModel, DbId, save!
import Base: @kwdef
export Book
@kwdef mutable struct Book <: AbstractModel
id::DbId = DbId()
title::String = "
author::String = "
title::String = ""
author::String = ""
end
end
Expand All @@ -740,7 +740,7 @@ function seed()
]
for b in BillGatesBooks
Book(title = b[1], author = b[2]) |> SearchLight.save!
Book(title = b[1], author = b[2]) |> save!
end
end
```
Expand All @@ -752,9 +752,16 @@ Now, to try things out. Genie takes care of loading all our resource files for u
```julia
using SearchLight
SearchLight.Configuration.load()
eval(Meta.parse("using SearchLight$(SearchLight.config.db_config_settings["adapter"])"))
SearchLight.connect()
try
SearchLight.Configuration.load()
if SearchLight.config.db_config_settings["adapter"] !== nothing
eval(Meta.parse("using SearchLight$(SearchLight.config.db_config_settings["adapter"])"))
SearchLight.connect()
end
catch ex
@error ex
end
```

---
Expand Down

0 comments on commit 3094b1d

Please sign in to comment.