This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: &default | |
adapter: postgresql | |
encoding: utf8 | |
pool: <%= ENV.fetch("RAILS_MAX_THREADS", 5) %> | |
local: &local | |
<<: *default | |
host: <%= ENV.fetch("PGHOST", "localhost") %> | |
username: <%= ENV.fetch("PGUSER", `whoami`.strip) %> | |
password: <%= ENV.fetch("PGPASSWORD", "") %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User::Create < Micro::Case | |
attributes :name, :age | |
def call! | |
return invalid_user unless valid? | |
if User.create(name: name, age: age) | |
Success | |
else | |
Failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Feedbacks: | |
#Remover os níveis extras i.e. | |
Micro::Case.config do |config| | |
config.enable_activemodel_validations = true | |
config.disable_transitions = true | |
config.disable_the_use_case_access_when_success = true | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query LearnAboutSchema { | |
__schema { | |
types { | |
name | |
kind | |
} | |
queryType { | |
fields { | |
name | |
description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query LearnAboutSchema { | |
__schema { | |
types { | |
name | |
kind | |
} | |
queryType { | |
fields { | |
name | |
description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
time="2017-10-26T14:24:42-02:00" level=debug msg="Got to backend... about to start query" | |
Started POST "/graphql" for ::1 at 2017-10-26 14:24:42 -0200 | |
Processing by GraphqlController#execute as */* | |
Parameters: {"query"=>"query{organization(id:\"1\"){name}}", "variables"=>{"input"=>{"duration"=>"1h", "imageUrl"=>"google.com", "location"=>"Jedi", "points"=>50, "startedAt"=>"2017-05-12", "title"=>"Woot"}, "organizationId"=>"1"}, "operationName"=>"", "extensions"=>nil, "graphql"=>{"query"=>"query{organization(id:\"1\"){name}}", "variables"=>{"input"=>{"duration"=>"1h", "imageUrl"=>"google.com", "location"=>"Jedi", "points"=>50, "startedAt"=>"2017-05-12", "title"=>"Woot"}, "organizationId"=>"1"}, "operationName"=>"", "extensions"=>nil}} | |
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] | |
Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.3ms) | |
time="2017-10-26T14:24:42-02:00" level=debug msg="Capturing trace." bucket=93 isError=true signature="que |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImplicitResolverInstrumentation | |
def instrument(_type, field) | |
implicit_resolver = "Resolvers::#{field.name.camelize}".safe_constantize | |
if implicit_resolver && default_or_connection_resolver?(field) | |
field.redefine do | |
resolve implicit_resolver | |
end | |
else | |
field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Resolvers | |
class CreateEvent | |
include Pundit | |
def self.call(*args) | |
new(*args).resolve | |
end | |
attr_reader :current_user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function PCMD() { | |
echo "%F{green}$(PR_DIR) %B$%b " | |
} | |
function RCMD() { | |
echo "$(git_prompt_string) %F{red}%B(%b%F{red}$(ruby_version)%B)%b %F{green}%B(%b%F{green}$(nodejs_version)%B)%b%{$reset_color%}" | |
} | |
function ruby_version() { | |
echo $(asdf current ruby | grep -o '[0-9.A-Za-z]*') |