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 V1::AddressBooksController < V1::BaseController | |
| def create | |
| @address_book = AddressBook.new address_book_params | |
| unless @address_book.save | |
| errors = @address_book.errors.to_hash(true) | |
| render status: 422, json: { errors: errors } | |
| end | |
| end | |
| private |
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
| module ActiveRecord | |
| module Scopes | |
| module SetOperations | |
| extend ActiveSupport::Concern | |
| class_methods do | |
| def union_scope(*scopes) | |
| apply_operation 'UNION', scopes | |
| end |
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
| function jankylog(msg) { | |
| let konsole = document.getElementById('jankylog'); | |
| if(!konsole) { | |
| konsole = document.createElement('pre'); | |
| konsole.id = 'jankylog'; | |
| konsole.style.backgroundColor = 'white'; | |
| konsole.style.padding = '1rem'; | |
| document.body.append(konsole); |
OlderNewer