flash-gordon on v1.3.3
flash-gordon on master
Bump version to 1.3.3 (compare)
flash-gordon on master
Update CHANGELOG (compare)
flash-gordon on master
Halt with mutable backtrace Ex… Merge pull request #116 from jo… (compare)
schema
inside each
, nested key syntax will be gone in 0.8.0
NoMethodError:
undefined method `merge' for #<Dry::Types::Definition primitive=String options={}>
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `each'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `reduce'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `merge_with'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:48:in `visit_form_hash'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:23:in `visit_type'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:15:in `visit'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:53:in `visit_key'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:15:in `visit'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `block in merge_with'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `map'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `merge_with'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:48:in `visit_form_hash'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:23:in `visit_type'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:15:in `visit'
# /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:11:in `call'
# /bundle/gems/dry-validation-0.7.2/lib/dry/validation/input_processor_compiler.rb:16:in `call'
# /bundle/gems/dry-validation-0.7.2/lib/dry/validation/schema.rb:118:in `input_processor'
# /bundle/gems/dry-validation-0.7.2/lib/dry/validation/schema.rb:141:in `default_options'
# /bundle/gems/dry-validation-0.7.2/lib/dry/validation/schema.rb:45:in `new'
# /bundle/gems/dry-validation-0.7.2/lib/dry/validation.rb:36:in `Schema'
# /bundle/gems/dry-validation-0.7.2/lib/dry/validation.rb:41:in `Form'
# ./app/forms/api/v1/share_holidays_form.rb:34:in `schema'
# ./app/forms/api/v1/share_holidays_form.rb:26:in `validate!'
# ./app/forms/api/v1/share_holidays_form.rb:14:in `attributes'
# ./spec/forms/api/v1/share_holidays_form_spec.rb:27:in `block (4 levels) in <top (required)>'
If I have container like:
require 'dry/web/container'
module Blog
class Container < Dry::Web::Container
setting :auto_register, 'lib'
configure do
load_paths!('lib')
end
end
end
and in lib directory I have for example repository, that require single arg when initialize, how I can do that? Container above register it automatically without any args,
module Persistence
module Repo
class Posts < ROM::Repository
relations :posts
def index
posts.to_a
end
end
end
end
>> Blog::Container['persistence.repo.posts']
ArgumentError: wrong number of arguments (given 0, expected 1)
from /Users/gotar/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/rom-repository-37ec20210a66/lib/rom/repository.rb:33:in `initialize'
include YourInjectModule[“your.rom.container”]
hmm ok then I define sth like:
require_relative 'container'
module Blog
Import = Container.import_module
def self.Import(*args)
Import[*args]
end
end
and then
require "blog/import"
module Persistence
module Repo
class Posts < ROM::Repository
include Blog::Import("persistence.rom")
relations :posts
def index
posts.to_a
end
end
end
end