fix the app because the blog post is wrong?
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
require 'rom-repository'
|
||||||
|
|
||||||
|
module EuchreCamp
|
||||||
|
module Repositories
|
||||||
|
class Players < ::EuchreCamp::Repository[:players]
|
||||||
|
commands :create, update: :by_pk, delete: :by_pk
|
||||||
|
|
||||||
|
def all
|
||||||
|
players.to_a
|
||||||
|
end
|
||||||
|
|
||||||
|
def by_id(id)
|
||||||
|
players.by_pk(id).one!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
require 'rom-repository'
|
||||||
|
|
||||||
|
module EuchreCamp
|
||||||
|
class Repository < ROM::Repository::Root
|
||||||
|
include Deps[container: 'persistence.rom']
|
||||||
|
end
|
||||||
|
end
|
||||||
Binary file not shown.
@@ -1,17 +0,0 @@
|
|||||||
module EuchreCamp
|
|
||||||
module Persistence
|
|
||||||
module Repositories
|
|
||||||
class Player < ROM::Repository[:players]
|
|
||||||
commands :create, update: :by_pk, delete: :by_pk
|
|
||||||
|
|
||||||
def all
|
|
||||||
players.to_a
|
|
||||||
end
|
|
||||||
|
|
||||||
def find(id)
|
|
||||||
players.by_pk(id).one!
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Reference in New Issue
Block a user