by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
John Krueger
@jtmkrueger
At some point did this functionality get removed? Or did the helpers get put in a different gem that I need to include as a dependency?
searching through the logs here I find a smattering of references, but nothing seems to pop up within the last couple years
if this did go away, how would the community suggest refactoring it?
(sorry for all the questions lately, I'm new to trailblazer and breathing life into old neglected codebases is hard)
Yogesh Khater
@yogeshjain999
Hey @jtmkrueger, I'm not really sure how old is that code but what version you're using ?
You can read more about how things tie up with Rails on http://trailblazer.to/gems/trailblazer/2.0/rails.html
John Krueger
@jtmkrueger
@yogeshjain999 I found a clue. trailblazer/trailblazer-compat#6
Looks like I'll be reverting to 2.0.7 from 2.1
Christer Jansson
@kondensatorn

Being a huge fan of rspec, I attempted this:

➜ bundle add rspec-trailblazer
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Could not find gem 'rspec-trailblazer' in any of the gem sources listed in your
Gemfile.

Sadness. Any ideas?

Christer Jansson
@kondensatorn
Apparently rspec-trailblazer is not listed on rubygems.org, is this intentional?
Nick Sutterer
@apotonick

Hey everyone! We decided to move our support communication channel to zulip-chat. It is golden-middle between groups/mailing lists and chats like gitter/slack/irc. It helps to organize discussions in threads, plus it got a nice interface that helps you to find any old discussion on a particular subject.

So in the end it will save a lot of time for all of us, and help all people who are looking for answers for specific questions that were already answered.
Of course at the beginning you can be confused a little bit because of quite raw interface, but in our experience - after day or two using it you should be happy about that transition.
So there is a link: https://trailblazer.zulipchat.com/join/od4yhihn6tra3ix39u4gks72/ and stay tuned! Because during the next days we will have a few more announcements related to the new website, new core team members, and plans about the future of trailblazer!

The Dry.rb team inspired us for this move! <3
John Krueger
@jtmkrueger
is this chat going to stay available? the logs are useful for finding mentioned things
I'm not asking to continue using it, just that it doesn't get blown away so that I can grep the logs :D
Adam Piotrowski
@adamsarin1_gitlab
I don't see any point to turining it off.
We will just make sure to replace links to zulip, so new users will join zulip
Nick Sutterer
@apotonick
@jtmkrueger We will also keep hopping in here every now and then
John Krueger
@jtmkrueger
Great, thanks for leaving it alive. I'm still working back in 2.0 land with compat so I'll need all the help I can get
(also still learning trailblazer, so understanding design choices and finding how folks refactored things in the past is super helpful)
simonovich
@simonovich

For TRB 1.1.2

class PostsController < ApplicationController
  def create
    respond Posts::Create, location: nil
  end

In the new trb version, respond does not work...

Nick Sutterer
@apotonick
@simonovich Yeah, sorry, we changed the way APIs work in 2.x
Gökhan Arlı
@sylow
@apotonick "Whoops. The confirmation link has expired or been deactivated." when trying to join zulip.... any invitation link for us?
Nick Sutterer
@apotonick
@sylow Working on it
We might invest some time to make it an ever-lasting link :laughing:
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"}
]}