by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
simonovich
@simonovich
@apotonick , could you explain how does it work now?
Adam Piotrowski
@adamsarin1_gitlab
@simonovich how zulipchat work? Or API in 2.1 ?;]
@sylow link worked?
Also i changed settings and you should be able to join just through https://trailblazer.zulipchat.com/
Juan Trejo
@trejo08
Hey guys, anyone knows a way to integrate swagger and generate api docs from trailblazer specs ?
I know that swagger can generate docs using DrySchemas but I'm loooking for a good way an practices to write specs and using at the same time to generate swager docs
Vivek Kumar
@viveksingh295_twitter

After upgrading from trailblazer 2.1.0rc1 to 2.1.0

class User::ValidateUpdate < Trailblazer::Operation
  step Model(User, :find_by, :custom_user_id)
  fail StepMacro::HandleNotFound, fail_fast: true
end


HandleNotFound = ->((ctx), *, &block) do
  ctx[:status] = :not_found
  if ctx[:model].nil?
    error = "#{ctx['model.class']} with the specified #{ctx['model.find_by_key']} cannot be found."
    ctx[:errors] << { field: ctx['model.find_by_key'].to_s, errors: [error] }
    Trailblazer::Operation::Railway.fail!
  end
end

Having issue with following code. model.class and model.find_by_key are null. any workaround for this ?

Adam Piotrowski
@adamsarin1_gitlab
Hey @viveksingh295_twitter since we moved this chat to https://trailblazer.zulipchat.com/ which helps us to organize all threads, could you please sign up there and ask same questions therE?
Arthur Leonard Andersen
@leoc
Hey there. Whats the best way to pretty print trailblazer operations and result objects? :)
Adam Piotrowski
@adamsarin1_gitlab
@leoc sorry for not giving you straight answer here, but we moved all communication to https://trailblazer.zulipchat.com/ - so if you could ask same question there, i will ensure that you will get your answer :) Since zulip is better in storing/searching given content, that would be more usefull for people that have same question
Arthur Leonard Andersen
@leoc
thanks, will do <3
Adam Piotrowski
@adamsarin1_gitlab
Great, thanks!
Mauricio
@banduk

Guys, I'having a problem with trailblazer in a rails app (6.0.3 on ruby 2.7.1)

NoMethodError: undefined method `failure' for Notification::Operation::Create:Class
module Notification::Operation
  class Create < BaseOperation
    ...
    failure :log!
    ...

Anyone knows if trailblazer is ready for this version of ror?

Mauricio
@banduk
Thanks @viveksingh295_twitter !
Adam Piotrowski
@adamsarin1_gitlab
Also @banduk please move communication to https://trailblazer.zulipchat.com/ , we are shutting down gitter slowly :)
simonovich
@simonovich
@apotonick, i mean my problems with api...
zulip works very well
Dmitrij Mukhin
@chaker05910
Hello guys , please help.
How can i render cases :
"a": {}, and "b": {"string"} ?
if i try to use property :a i received : undefined method 'a=' for ...
if: property :a do property :e end
Received undefined method 'call' for nil:NilClass
Rendering_nil = true not help...
Really don't know what to do...
Andrey Khataev
@khataev
Guys, how are you managing with fail step wich triggers rubocop's Style/SignalException and Lint/UnreachableCode ? I don't want to turn them off at all, but disabling in-place in almost every operation is boring...
Nardo Nykołyszyn
@nardonykolyszyn
What's the difference between an interactor and an operation?
Dmitriy Goncharov
@int18h

Hello, guys. Could you please help me with Reform::Form.

  class SearchForm < Reform::Form
    feature Coercion
    property :lat, virtual: true, type: Types::Nominal::Float
    property :lon, virtual: true, type: Types::Nominal::Float
    property :query_type, virtual: true, type: ::Types::Nominal::String
    property :q, virtual: true, type: Types::Nominal::String
    property :radius, virtual: true, type: Types::Nominal::Float, default: 200
  end

I set up types for properties in Form with feature Coercion. As I read from reform documentation these types are valid only during validation.
How to apply types to form fields to be sure that I can use float values (not strings by default) as values of properties.

Adam Piotrowski
@adamsarin1_gitlab
Hello @chaker05910 @khataev @nardonykolyszyn @int18h
Sorry for such a late response - we are shutting down gitter, and moving whole communication to zulipchat where we can easly organize threads and search for older content/discussions. Please ask same questions at https://trailblazer.zulipchat.com/ - you will get your answers there from someone from community or core team.
Nolan Tait
@nolantait

Anybody have good solutions for handling polymorphic collections with Reform?

I have a Resource model which belongs_to: source, polymorphic: true

I have something like:

class Form < Reform::Form
  collection(
    :resources,
    populate_if_empty: Resource,
  ) do
    property :source, form: Source::Form
  end
end

I've tried a sad hack that strips my definitions in the source form:

module Source
  module Form
    def self.new(model)
      model.class::Create::Form.new(model)
    end

    def self.definitions()
      []
    end
  end
end

But this leads to some issues with validation and prepopulating the form after errors (I lose objects that do not have a hash). Anybody have any tips for how they handle this? I'm thinking of just managing the children and errors manually myself but wanted to ask anyways

Nolan Tait
@nolantait
Sorry, just saw above too, I'll repost
ThavasipitchiahRaja
@pitchiah77_twitter
HI Need help on creating the json structure as below
{name:"servername", "rows":[
{versions:"hhhhhhhhhhhhhh"},
{versions:"hhhhhhhhhhhhhh"},
{versions:"hhhhhhhhhhhhhh"},
{versions:"hhhhhhhhhhhhhh"}
]}
can any one help me
ThavasipitchiahRaja
@pitchiah77_twitter
Hi All, Need help on creating the json structure as below
{name:"servername", "rows":[
{versions:"hhhhhhhhhhhhhh"},
{versions:"hhhhhhhhhhhhhh"},
{versions:"hhhhhhhhhhhhhh"},
{versions:"hhhhhhhhhhhhhh"}
]}
can any one help me
Kamil Milewski
@KamilMilewski
@pitchiah77_twitter
we are shutting down gitter, and moving whole communication to zulipchat where we can easly organize threads and search for older content/discussions. Please ask same questions at https://trailblazer.zulipchat.com/ - you will get your answers there from someone from community or core team.
ThavasipitchiahRaja
@pitchiah77_twitter
@KamilMilewski Thanks
Marc Seifert
@levelone
hi folks.. still fairly new to trailblazer.. does anyone know if Reform::Form supports property blocks with nested collections?
Marc Seifert
@levelone
confirmed.. this works ^