Questions tagged [trailblazer]

Trailblazer is a thin layer on top of Rails. It gently enforces encapsulation, an intuitive code structure and gives you an object-oriented architecture.

Trailblazer gives you a high-level architecture for web applications. It extends the basic MVC pattern with new abstractions. Rock-solid conventions that go far beyond database table naming or route paths let you focus on your application code, minimize bugs and improve the maintainability.

https://github.com/trailblazer/trailblazer

61 questions
1
vote
2 answers

Can a Trailblazer concept inherit from another and be able to extend its operations (multiple inheritance)?

Consider an abstract Tag concept where there are different kinds of tags, say Topic and Location (amongst others), that are unrelated apart from being tags. They have the same base Tag properties in common but are otherwise different. A Topic…
starfry
  • 9,273
  • 7
  • 66
  • 96
1
vote
2 answers

Can an inherited Trailblazer operation's contract alter validations defined by its superclass?

When a Trailblazer operation is defined by inheritance, it inherits its superclass's contract: class Create < Trailblazer::Operation contract do ... end ... end class Update < Create ... end Can an inherited Trailblazer operation's…
starfry
  • 9,273
  • 7
  • 66
  • 96
1
vote
2 answers

How to test/mock Trailblazer operations that interact with external gems?

I'm loving all the object oriented beauty of Trailblazer! I have an operation that interacts with a gem (called cpanel_deployer) to do something externally on the web. (It adds an addon domain to a cpanel.) class Website::Deploy <…
Josh
  • 655
  • 5
  • 17
1
vote
1 answer

Trailblazer error when running operation: "NoMethodError: undefined method `has_key?' for nil:NilClass"

When I try to run a Create operation with the trailblazer gem, I get this error: NoMethodError: undefined method `has_key?' for nil:NilClass
neurodynamic
  • 4,294
  • 3
  • 28
  • 39
1
vote
1 answer

Trailblazer and Minitest - NameError: uninitialized constant MiniTest

Environment: rails -v Rails 4.2.5 ruby -v ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux-gnu] bundle list trailblazer trailblazer-1.1.0 I am working through the examples in the Trailblazer book and I have run into a situation that I do…
James B. Byrne
  • 1,048
  • 12
  • 27
1
vote
3 answers

Identical inheritance pattern in multiple classes

I have the following situation: class A < CommonParent ... some code ... class IdenticalDescendent < self identical_statement_0 identical_statement_1 end end class B < CommonParent ... some other code ... class…
wmjbyatt
  • 686
  • 5
  • 15
1
vote
1 answer

Operation to create a collection

I want to create an operation which accepts a json array and creates several objects. Something like Books::CreateCollection. I believe I need to somehow reuse Books::Create - just call it multiple times and wrap the whole loop in transaction.…
freemanoid
  • 14,592
  • 6
  • 54
  • 77
0
votes
1 answer

Salesforce Apex: How to properly implement the simple unit test from the trailhead example?

I'm following the Apex Rest Callouts trail which instructs you to write a unit test for a sample class. All code is given, you just need to add it into their ide. The problem is, one line from the trail's code errors and I have no prior Apex…
Moritz Roessler
  • 8,542
  • 26
  • 51
0
votes
0 answers

Can't Modify Frozen Class & Can't Determine Why Class is Frozen

I'm working on a Ruby on Trailblazer API and I keep getting this error when I run my Rspec test suite: FrozenError: can't modify frozen #: NotificationCenter I can't seem to determine where or how the class is being…
0
votes
0 answers

Dry-validation/Dry-schema uninitialized constant Dry::Schema::PredicateRegistry

I'm attempting to update the ruby version of an empty, stock API (which is forked to create new API) from Ruby 2.6.3 to Ruby 2.7.3 using TrailBlazer. Currently, I'm having issues with the Dry gems, specifically Dry-Validation (1.8.0), Dry-Schema…
0
votes
1 answer

How to represent object properties in given context?

I am looking for a solution to my problem I have a relation => Company has_many Councils, through CouncilCompany. And I would like to display Company in context of given Council, so if CouncilCompany has name property present display it over default…
tomekfranek
  • 6,852
  • 8
  • 45
  • 80
0
votes
1 answer

Trailblazer Reform Contract - dry-validate - Virtual Field Validation

I am trying to create a registration form with Trailblazer and validation setup using Dry-Validation. I hit a snag which seems to be related to virtual fields. My contract looks like this. module User::Contract class Register < Reform::Form …
Ziyan Junaideen
  • 3,270
  • 7
  • 46
  • 71
0
votes
1 answer

Reform Rails - Validation - Wrong Number Arguments

I am trying out Reform using the reform-rails gem for the first time. I am trying to use it as a form object, do some validation and then persist it to the database. When I try to specify a validation it gives an error even when I try one of its own…
Ziyan Junaideen
  • 3,270
  • 7
  • 46
  • 71
0
votes
1 answer

Create button in VF Email Template to Reopen Cases

I'm trying to create an email template to send to the user when his case is closed. In this email there will be a button and if the user clicks on it the case will be reopen. Is there a way to do this? If not, are there any other ways to make the…
0
votes
1 answer

How to pass a return value of operation to view?

I've been spent a lot of time and still trying figure out how to pass a result(return) of operation to my view. As regarding documentation I created cell, operation and view folders inside concepts folder. I'm working with Search app, here is my…