This file contains hidden or 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 CreateAction < BaseTransaction | |
Contract = Dry::Validation::Contract.build do | |
params do | |
required(:mark_task_discussion_done).maybe(:bool) | |
required(:task_message).hash do | |
required(:user_id).filled(:integer) | |
required(:task_discussion_id).filled(:integer) | |
required(:body).filled(:string) | |
optional(:add_answer_attachments).maybe(:bool) | |
optional(:attachments).maybe(:array?) |
This file contains hidden or 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
HashAggregate (cost=8.16..8.62 rows=37 width=13) | |
Group Key: courses.id | |
-> Hash Join (cost=4.87..7.80 rows=48 width=20) | |
Hash Cond: (discountings.discountable_id = courses.id) | |
-> Hash Join (cost=2.04..4.83 rows=48 width=24) | |
Hash Cond: (discountings.discount_id = discounts.id) | |
-> Seq Scan on discountings (cost=0.00..2.60 rows=48 width=16) | |
Filter: ((discountable_type)::text = 'Course'::text) | |
-> Hash (cost=2.02..2.02 rows=1 width=24) | |
-> Nested Loop Left Join (cost=0.00..2.02 rows=1 width=24) |
This file contains hidden or 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
import { Controller } from '@hotwired/stimulus'; | |
export default class extends Controller { | |
static targets = ['filterOption', 'filterList']; | |
#compareOptions(searchText, a, b) { | |
const aText = a.textContent.toLowerCase(); | |
const bText = b.textContent.toLowerCase(); | |
const aIndex = aText.indexOf(searchText); | |
const bIndex = bText.indexOf(searchText); |