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 UserSerializer { | |
constructor(user) { | |
this.user = user; | |
} | |
serialize() { | |
return ( | |
{ | |
name: this.user.name, |
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
version: '3' | |
services: | |
db: | |
image: postgres | |
volumes: | |
- ./tmp/db:/var/lib/postgresql/data | |
web: | |
build: . | |
command: bundle exec rails s -p 3000 -b '0.0.0.0' | |
volumes: |
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
soubh_old: | |
adapter: postgresql | |
database: soubh_v4_portal | |
username: postgres | |
password: <%= ENV['SOUBH-BACKEND_OLD_DATABASE_PASSWORD'] %> | |
host: <%= ENV['SOUBH-BACKEND_OLD_DATABASE_HOST'] %> |
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
validates :datetime_is_not_in_past, if: :datetime_not_nil? | |
def datetime_is_not_in_past | |
errors.add(:datetime_field_name, :invalid, message: "cannot be in the past") if self.datetime_field_name < DateTime.current | |
end | |
def datetime_not_nil? | |
!self.datetime_field_name.nil? | |
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
bundle config build.pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.6/bin/pg_config |
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
def sort_records(records) | |
sort_by = [] | |
params[:order].to_unsafe_h.each do |item| | |
sort_by << "#{sort_column(item[1]["column"])} #{sort_direction(item[1]["dir"])}" | |
end | |
records.order(sort_by.join(", ")) | |
end | |
def sort_column(item) |
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 Api::V1::BaseController < ApplicationController | |
protect_from_forgery with: :null_session | |
serialization_scope :current_user | |
include ResourceLoader | |
include TokenAuthentication | |
after_action :build_response_headers |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Font-also</title> | |
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" media="screen" title="no title" charset="utf-8"> | |
<style media="screen"> |
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
default: &default | |
adapter: mysql2 | |
encoding: utf8 | |
pool: 5 | |
username: root | |
password: root | |
socket: <%= [ | |
'/var/lib/mysql/mysql.sock', | |
'/var/run/mysqld/mysqld.sock', | |
'/tmp/mysqld.sock', |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Summernote1</title> | |
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet"> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script> | |
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script> | |
<script src="//cdn.jsdelivr.net/medium-editor/latest/js/medium-editor.min.js"></script> | |
<link rel="stylesheet" href="//cdn.jsdelivr.net/medium-editor/latest/css/medium-editor.min.css" type="text/css" media="screen" charset="utf-8"> |
NewerOlder