Sha256: 0703da7f37c8e276946c425c5563d9d36ff3a0d12d100a3cdf6c6300cf2f6902

Contents?: true

Size: 264 Bytes

Versions: 5

Compression:

Stored size: 264 Bytes

Contents

class <%= model_name %>Repository < ROM::Repository::Root
  root <%= ":#{relation}" %>

  commands :create, update: :by_pk, delete: :by_pk

  struct_namespace <%= struct_namespace %>

  def by_id(id)
    root.by_pk(id).one
  end

  def all
    root.to_a
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rom-rails-2.4.0 lib/generators/rom/repository/templates/repository.rb.erb
rom-rails-2.3.1 lib/generators/rom/repository/templates/repository.rb.erb
rom-rails-2.3.0 lib/generators/rom/repository/templates/repository.rb.erb
rom-rails-2.2.0 lib/generators/rom/repository/templates/repository.rb.erb
rom-rails-2.0.0 lib/generators/rom/repository/templates/repository.rb.erb