diff --git a/app/controllers/gangs_controller.rb b/app/controllers/gangs_controller.rb new file mode 100644 index 0000000..dd70326 --- /dev/null +++ b/app/controllers/gangs_controller.rb @@ -0,0 +1,40 @@ +class GangsController < ApplicationController + def index + json_response Gang.all + rescue StandardError + error_response :bad_request + end + + def create + gang = Gang.create(gang_params) + if gang.save + json_response Gang.all + else + error_response :bad_request + end + + rescue StandardError + error_response :bad_request + end + + def update + if gang_params[:chip_scale].to_i.positive? + Gang.update(gang_params) + json_response onboarded: true + else + error_response :bad_request + end + end + + private + + def gang_params + params.require(:gang).permit :name, + :about, + :chip_name, + :chip_code, + :chip_symbol, + :chip_scale, + :chip_prefixed + end +end diff --git a/app/controllers/homies_controller.rb b/app/controllers/homies_controller.rb index 4d2da8a..ff64f42 100644 --- a/app/controllers/homies_controller.rb +++ b/app/controllers/homies_controller.rb @@ -1,6 +1,8 @@ class HomiesController < ApplicationController def index - json_response(Homie.all.order(importance: :desc, name: :asc)) + homies = Homie.where(gang: params[:gang_id]).order(importance: :desc, name: :asc) + # json_response(Homie.all.order(importance: :desc, name: :asc)) + json_response homies end def create @@ -23,7 +25,8 @@ class HomiesController < ApplicationController def info importance = params[:importance].present? ? params[:importance].to_i : -1 - json_response(Homie.info(importance)) + gang = params[:gang_id] + json_response(Homie.info(importance, gang)) end def settle @@ -46,7 +49,8 @@ class HomiesController < ApplicationController params.require(:homie).permit( :name, :importance, - :about + :about, + :gang_id ) end end diff --git a/app/controllers/original_gangstas_controller.rb b/app/controllers/original_gangstas_controller.rb deleted file mode 100644 index 2d5debe..0000000 --- a/app/controllers/original_gangstas_controller.rb +++ /dev/null @@ -1,28 +0,0 @@ -class OriginalGangstasController < ApplicationController - def show - if OriginalGangsta.count.zero? - OriginalGangsta.create.save - end - - json_response OriginalGangsta.first - end - - def update - if original_gangsta_params[:chip_scale].to_i.positive? - OriginalGangsta.update(original_gangsta_params) - json_response onboarded: true - else - error_response :bad_request - end - end - - private - - def original_gangsta_params - params.require(:original_gangsta).permit :chip_name, - :chip_code, - :chip_symbol, - :chip_scale, - :chip_prefixed - end -end diff --git a/app/models/gang.rb b/app/models/gang.rb new file mode 100644 index 0000000..00db4a6 --- /dev/null +++ b/app/models/gang.rb @@ -0,0 +1,3 @@ +class Gang < ApplicationRecord + has_many :homies +end \ No newline at end of file diff --git a/app/models/homie.rb b/app/models/homie.rb index 65e5271..9ad4538 100644 --- a/app/models/homie.rb +++ b/app/models/homie.rb @@ -2,11 +2,15 @@ class Homie < ApplicationRecord has_many :money_moves has_many :work - def self.info(importance) + belongs_to :gang + + def self.info(importance, gang) + # TODO: This can be improved + cash_totals = Homie.all.joins(:money_moves).group(:id).order(:id).sum(:amount) work_totals = Homie.all.joins(:work).group(:id).order(:id).sum(:amount) - Homie.where(["importance > ?", importance]).map do |homie| + Homie.where(['importance > ? and gang_id = ?', importance, gang]).map do |homie| cash_total = cash_totals.fetch(homie.id, 0) work_total = work_totals.fetch(homie.id, 0) { homie: homie, amount: cash_total, work: work_total } diff --git a/app/models/original_gangsta.rb b/app/models/original_gangsta.rb deleted file mode 100644 index a579514..0000000 --- a/app/models/original_gangsta.rb +++ /dev/null @@ -1,3 +0,0 @@ -class OriginalGangsta < ApplicationRecord - -end \ No newline at end of file diff --git a/client/src/App.css b/client/src/App.css index d5bdbce..2085026 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -54,4 +54,8 @@ position: absolute; height: 90%; margin-left: 40%; +} + +.bump { + margin-left: 2em; } \ No newline at end of file diff --git a/client/src/App.js b/client/src/App.js index 2c8d82b..8f50db0 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import './App.css'; -import { Navbar } from 'react-materialize'; +import { Navbar, Dropdown, Icon } from 'react-materialize'; import MakeMoneyMove from './cash/MakeMoneyMove'; import Flow from "./homies/Flow"; import Cash from './cash/Cash'; @@ -10,27 +10,31 @@ import RoutableNavItem from './common/RoutableNavItem'; import axios from 'axios'; import { CRIB, + GANGS, MAKE_MONEY_MOVE, HOMIE_FLOW, HOMIES, PUT_IN_WORK } from './RouteNames'; import PutInWork from "./cash/PutInWork"; -import ChipSelection from "./originalGangstaOnboarding/ChipSelection"; +import GangOnboarding from "./gangOnboarding/GangOnboarding"; +import Gangs from './gangs/Gangs'; import {errorToast} from "./common/errorHelpers"; const App = (props) => { const [loading, setLoading] = useState(true); - const [originalGangsta, setOriginalGangsta] = useState({}); + const [gangs, setGangs] = useState([]); + const [selectedGang, setSelectedGang] = useState({}); useEffect(() => { (async() => { try { setLoading(true); - const response = await axios.get(`/api/original_gangstas/0`); + const response = await axios.get(`/api/gangs`); if (response.status === 200 && response.data){ - setOriginalGangsta(response.data); + setGangs(response.data); + setSelectedGang(response.data[0]); }else{ errorToast(); } @@ -42,15 +46,16 @@ const App = (props) => { }, []); const routes = ([ - } />, - } />, - } />, - } />, - } /> + } />, + } />, + } />, + } />, + } />, + } /> ] ); - const onboarded = () => originalGangsta.chip_name && originalGangsta.chip_name.length > 0; + const onboarded = () => selectedGang.chip_name && selectedGang.chip_name.length > 0; const preloaderCircle = (
@@ -72,15 +77,42 @@ const App = (props) => {
); + const navbarLogoWithGang = ( +
+ GKS + + {selectedGang && selectedGang.name && selectedGang.name.length > 0 ? `${selectedGang.name} gang` : '[No name gang]'}arrow_drop_down} + > + {gangs.map(gang => setSelectedGang(gang)}>{gang.name})} + +
+ ); + return (
- GKS} alignLinks="right"> + Crib + + Gangs + + Homies @@ -97,7 +129,7 @@ const App = (props) => {
{ loading && preloaderCircle } - { !loading && !onboarded() && } + { !loading && !onboarded() && } { !loading && onboarded() && routes }
diff --git a/client/src/RouteNames.js b/client/src/RouteNames.js index 446919b..98ccb73 100644 --- a/client/src/RouteNames.js +++ b/client/src/RouteNames.js @@ -3,3 +3,4 @@ export const HOMIES = '/homies'; export const MAKE_MONEY_MOVE = '/make-money-move'; export const PUT_IN_WORK = '/put-in-work'; export const HOMIE_FLOW = '/homie/:homie_id/flow'; +export const GANGS = '/gangs'; diff --git a/client/src/cash/Cash.js b/client/src/cash/Cash.js index 331591e..c3848b0 100644 --- a/client/src/cash/Cash.js +++ b/client/src/cash/Cash.js @@ -11,12 +11,12 @@ import M from 'materialize-css'; const Cash = (props) => { const [homiesCash, setHomiesCash] = useState([]); - const originalGangsta = props.originalGangsta; + const gang = props.gang; useEffect( () => { const getCashForHomies = async () => { try { - const cash = await axios.get(`/api/homies/info`); + const cash = await axios.get(`/api/gangs/${gang.id}/homies/info`); setHomiesCash(cash.data); } catch (e) { console.log("Error fetching", e); @@ -27,7 +27,7 @@ const Cash = (props) => { const settleFlowForHomie = async (id, amountToSettle) => { try { - const response = await axios.post(`/api/homies/${id}/settle`, { amount: amountToSettle }); + const response = await axios.post(`/api/gangs/${gang.id}/homies/${id}/settle`, { amount: amountToSettle }); if (response.status === 200 && response.data) { M.toast({ html: 'Settled' }); setHomiesCash(response.data); @@ -49,7 +49,7 @@ const Cash = (props) => { { formatTime(homieLine.work) } - { formatMoney(homieLine.amount, originalGangsta) } + { formatMoney(homieLine.amount, gang) } [ diff --git a/client/src/cash/MakeMoneyMove.js b/client/src/cash/MakeMoneyMove.js index 8b8ccd5..6f47c03 100644 --- a/client/src/cash/MakeMoneyMove.js +++ b/client/src/cash/MakeMoneyMove.js @@ -5,7 +5,6 @@ import './Cash.css'; import axios from 'axios'; const MakeMoneyMove = (props) => { - const [selectedFrom, setSelectedFrom] = useState(""); const [selectedTo, setSelectedTo] = useState("-1"); const [homiesCash, setHomiesCash] = useState([]); @@ -13,10 +12,12 @@ const MakeMoneyMove = (props) => { const [moveDescription, setMoveDescription] = useState(""); const [submitInProgress, setSubmitInProgress] = useState(false); + const gang = props.gang; + useEffect(() => { const getCashForHomies = async () => { try { - const cash = await axios.get(`/api/homies/info`); + const cash = await axios.get(`/api/gangs/${gang.id}/homies/info`); setHomiesCash(cash.data); } catch (e) { console.log("Error fetching", e); diff --git a/client/src/cash/PutInWork.js b/client/src/cash/PutInWork.js index 62f9c1b..f864f82 100644 --- a/client/src/cash/PutInWork.js +++ b/client/src/cash/PutInWork.js @@ -12,10 +12,12 @@ const PutInWork = (props) => { const [workDescription, setWorkDescription] = useState(''); const [submitInProgress, setSubmitInProgress] = useState(false); + const gang = props.gang; + useEffect(() => { (async () => { try { - const response = await axios.get('/api/homies'); + const response = await axios.get(`/api/gangs/${gang.id}/homies`); if (response.status === 200 && response.data){ setHomies(response.data); } diff --git a/client/src/originalGangstaOnboarding/ChipSelection.js b/client/src/gangOnboarding/GangOnboarding.js similarity index 68% rename from client/src/originalGangstaOnboarding/ChipSelection.js rename to client/src/gangOnboarding/GangOnboarding.js index 1bd167c..5f5dcb3 100644 --- a/client/src/originalGangstaOnboarding/ChipSelection.js +++ b/client/src/gangOnboarding/GangOnboarding.js @@ -1,11 +1,14 @@ import React, { useState, useEffect } from 'react'; import axios from "axios"; import { errorToast } from "../common/errorHelpers"; -import {Button, Select, TextInput} from "react-materialize"; +import {Button, Select} from "react-materialize"; -const ChipSelection = (props) => { +const GangOnboarding = (props) => { const [chips, setChips] = useState([]); const [selectedChip, setSelectedChip] = useState('1'); + const [gangName, setGangName] = useState(''); + + const gang = props.gang; useEffect(() => { (async() => { @@ -25,22 +28,23 @@ const ChipSelection = (props) => { const chipsToOptions = chips.map( (chip, index) => ); const disableSubmit = () => { - return !(parseInt(selectedChip) > 0); + return parseInt(selectedChip) === 0 || gangName.length === 0 ; } const handleSubmit = async () => { const chipData = chips.find(chip => chip.id === parseInt(selectedChip)); if (chipData){ - const originalGangsta = { + const updatedGang = { chip_name: chipData.name, chip_code: chipData.code, chip_symbol: chipData.symbol, chip_prefixed: chipData.prefixed, - chip_scale: chipData.scale + chip_scale: chipData.scale, + name: gangName } try{ - const response = await axios.put('/api/original_gangstas/0', { 'original_gangsta': originalGangsta }); + const response = await axios.put(`/api/gangs/${gang.id}`, { 'gang': updatedGang }); if (response.status === 200 && response.data && response.data.onboarded) { window.location.reload(); }else{ @@ -56,6 +60,12 @@ const ChipSelection = (props) => { return (
+ +
+ setGangName(e.target.value)} /> + +
+ @@ -67,4 +77,4 @@ const ChipSelection = (props) => { ) } -export default ChipSelection; \ No newline at end of file +export default GangOnboarding; \ No newline at end of file diff --git a/client/src/gangs/Gangs.js b/client/src/gangs/Gangs.js new file mode 100644 index 0000000..b36fe6d --- /dev/null +++ b/client/src/gangs/Gangs.js @@ -0,0 +1,59 @@ +import React, { useEffect, useState } from 'react'; +import NewGangForm from "./NewGangForm"; +import axios from "axios"; +import {errorToast} from "../common/errorHelpers"; +import YesNoModal from "../common/YesNoModal"; +import {Button} from "react-materialize"; +import M from "materialize-css"; + +const Gangs = (props) => { + const gangs = props.gangs; + const setGangs = props.gangsSetter; + + const deleteGang = async (id) => { + try { + const response = await axios.delete(`/api/gangs/${id}`); + if (response.status === 200 && response.data){ + setGangs(response.data); + M.toast({ html: "See y'a on the other side" }); + }else{ + errorToast(); + } + }catch (e) { + console.log(e); + errorToast(); + } + } + + const gangsData = gangs.map((gang, index) => { + return ( +
  • +
    +
    +
    +
    { gang.name }
    +
    { `${gang.about || '[no about]'} • ${gang.chip_name} (${gang.chip_code})`}
    +
    + + deleteGang(gang.id)} + triggerNode={
    +
    +
  • + ) + }); + + return ( +
    + + +
      + { gangsData } +
    +
    + ) +} + +export default Gangs; \ No newline at end of file diff --git a/client/src/gangs/NewGangForm.js b/client/src/gangs/NewGangForm.js new file mode 100644 index 0000000..23baf23 --- /dev/null +++ b/client/src/gangs/NewGangForm.js @@ -0,0 +1,110 @@ +import React, { useEffect, useState } from 'react'; +import { Button, Collapsible, CollapsibleItem, Select, TextInput } from 'react-materialize'; +import axios from 'axios'; +import { errorToast } from "../common/errorHelpers"; +import M from 'materialize-css'; + +const NewGangForm = (props) => { + const [gangName, setGangName] = useState(""); + const [aboutGang, setAboutGang] = useState(""); + const [chips, setChips] = useState([]); + const [selectedChip, setSelectedChip] = useState('1'); + const [busy, setBusy] = useState(false); + + useEffect(() => { + (async() => { + try { + const response = await axios.get(`/api/chips`); + if (response.status === 200 && response.data){ + setChips(response.data); + }else{ + errorToast(); + } + } catch (e) { + errorToast(); + } + })(); + }, []); + + const chipsToOptions = chips.map( (chip, index) => ); + + const disableAddButton = () => { + return gangName.length === 0 || busy; + } + + const clearForm = () => { + setGangName(""); + setAboutGang(""); + + const collapsible = document.getElementById('new-gang-form-container'); + const collapsibleInstance = M.Collapsible.getInstance(collapsible); + + collapsibleInstance.close(0); + } + + const addNewGang = async () => { + const chipData = chips.find(chip => chip.id === parseInt(selectedChip)); + if (chipData) { + setBusy(true); + const newGang = { + chip_name: chipData.name, + chip_code: chipData.code, + chip_symbol: chipData.symbol, + chip_prefixed: chipData.prefixed, + chip_scale: chipData.scale, + name: gangName, + about: aboutGang + } + + try { + const response = await axios.post('/api/gangs', {gang: newGang}); + if (response.status === 200 && response.data) { + props.newGangsSetter(response.data); + M.toast({html: 'Welcome to the Hood'}); + clearForm(); + } else { + errorToast(); + } + } catch (e) { + console.log(e.message); + errorToast(); + } + + setBusy(false); + }else{ + errorToast(); + } + } + + return ( +
    + + {`Introduce new gang to the Hood`}}> +
    + setGangName(e.target.value)} /> + + +
    + + setAboutGang(e.target.value)} + /> + + + +
    + + + +
    +
    +
    + ) +} + +export default NewGangForm; \ No newline at end of file diff --git a/client/src/homies/CashFlow.js b/client/src/homies/CashFlow.js index 4694011..c71a229 100644 --- a/client/src/homies/CashFlow.js +++ b/client/src/homies/CashFlow.js @@ -7,7 +7,7 @@ import {errorToast} from "../common/errorHelpers"; const CashFlow = (props) => { const { homie_id } = useParams(); - const originalGangsta = props.originalGangsta; + const gang = props.gang; const [cashFlow, setCashFlow] = useState([]); @@ -35,7 +35,7 @@ const CashFlow = (props) => {
    { dateBlock(singleFlowData['created_at']) }
    -
    0 ? 'amount-green' : ''}`}>{ formatMoney(singleFlowData.amount, originalGangsta) }
    +
    0 ? 'amount-green' : ''}`}>{ formatMoney(singleFlowData.amount, gang) }
    @@ -58,7 +58,7 @@ const CashFlow = (props) => { {`${totalCount} Records`}{` • ${fromDate} - ${toDate}`}
    - Total cash flow: {formatMoney(totalFlow, originalGangsta)} + Total cash flow: {formatMoney(totalFlow, gang)}
    diff --git a/client/src/homies/Flow.js b/client/src/homies/Flow.js index 78eb8f5..c2b2d9f 100644 --- a/client/src/homies/Flow.js +++ b/client/src/homies/Flow.js @@ -7,7 +7,7 @@ import WorkFlow from "./WorkFlow"; const Flow = (props) => { const [flowType, setFlowType] = useState('cash'); - const originalGangsta = props.originalGangsta; + const gang = props.gang; return (
    @@ -19,7 +19,7 @@ const Flow = (props) => { />
    - { flowType === 'cash' && } + { flowType === 'cash' && } { flowType === 'work' && } diff --git a/client/src/homies/Homies.js b/client/src/homies/Homies.js index 3e7ffdd..646cbcc 100644 --- a/client/src/homies/Homies.js +++ b/client/src/homies/Homies.js @@ -10,10 +10,12 @@ import YesNoModal from "../common/YesNoModal"; const Homies = (props) => { const [homies, setHomies] = useState([]); + const gang = props.gang; + useEffect(() => { (async() => { try { - const response = await axios.get(`/api/homies`); + const response = await axios.get(`/api/gangs/${gang.id}/homies`); if (response.status === 200 && response.data){ setHomies(response.data); }else{ @@ -27,7 +29,7 @@ const Homies = (props) => { const deleteHomie = async (id) => { try { - const response = await axios.delete(`/api/homies/${id}`); + const response = await axios.delete(`/api/gangs/${gang.id}/homies/${id}`); if (response.status === 200 && response.data){ setHomies(response.data); M.toast({ html: "See y'a on the other side Homie" }); @@ -62,7 +64,7 @@ const Homies = (props) => { return (
    - +
      { homiesData } diff --git a/client/src/homies/NewHomieForm.js b/client/src/homies/NewHomieForm.js index 04fcec3..187265e 100644 --- a/client/src/homies/NewHomieForm.js +++ b/client/src/homies/NewHomieForm.js @@ -10,6 +10,8 @@ const NewHomieForm = (props) => { const [homieImportance, setHomieImportance] = useState(""); const [busy, setBusy] = useState(false); + const gang = props.gang; + const disableAddButton = () => { return homieName.length === 0 || homieImportance === "" || @@ -33,15 +35,16 @@ const NewHomieForm = (props) => { homie: { name: homieName, about: aboutHomie, - importance: parseInt(homieImportance) + importance: parseInt(homieImportance), + gang_id: gang.id } } try{ - const response = await axios.post('/api/homies', newHomie); + const response = await axios.post(`/api/gangs/${gang.id}/homies`, newHomie); if (response.status === 200 && response.data) { props.newHomiesSetter(response.data); - M.toast({ html: 'Welcome to the hood' }); + M.toast({ html: 'Welcome to the Gang' }); clearForm(); }else{ errorToast(); @@ -57,7 +60,7 @@ const NewHomieForm = (props) => { return (
      - Introduce new homie to the Hood}> + {`Introduce new homie to the ${gang.name} gang`}}>
      setHomieName(e.target.value)} /> @@ -83,7 +86,7 @@ const NewHomieForm = (props) => {
      - + diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 9f8e25d..ab4f265 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -17,5 +17,4 @@ ActiveSupport::Inflector.inflections do |inflect| inflect.irregular 'work', 'work' - inflect.irregular 'gangsta', 'gangstas' end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 6ebc143..06d8614 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,19 +1,20 @@ Rails.application.routes.draw do constraints format: :json do scope :api do - resources :original_gangstas, only: [:show, :update] + resources :gangs, only: [:index, :create, :update] do + resources :homies, param: :homie_id do + collection do + get 'info' + end + member do + post 'settle' + end + end + end resources :money_moves resources :work resources :chips, only: %i[index create destroy] resources :chip_values, only: %i[create update destroy] - resources :homies, param: :homie_id do - collection do - get 'info' - end - member do - post 'settle' - end - end end end diff --git a/db/migrate/20201007180902_rename_original_gangstas_to_gangs.rb b/db/migrate/20201007180902_rename_original_gangstas_to_gangs.rb new file mode 100644 index 0000000..68ccbc1 --- /dev/null +++ b/db/migrate/20201007180902_rename_original_gangstas_to_gangs.rb @@ -0,0 +1,5 @@ +class RenameOriginalGangstasToGangs < ActiveRecord::Migration[5.2] + def change + rename_table :original_gangstas, :gangs + end +end \ No newline at end of file diff --git a/db/migrate/20201007182916_add_name_to_gangs.rb b/db/migrate/20201007182916_add_name_to_gangs.rb new file mode 100644 index 0000000..379adb5 --- /dev/null +++ b/db/migrate/20201007182916_add_name_to_gangs.rb @@ -0,0 +1,6 @@ +class AddNameToGangs < ActiveRecord::Migration[5.2] + def change + add_column :gangs, :name, :text + add_column :gangs, :about, :text + end +end \ No newline at end of file diff --git a/db/migrate/20201007183139_add_gang_relation_to_homies.rb b/db/migrate/20201007183139_add_gang_relation_to_homies.rb new file mode 100644 index 0000000..b1808a4 --- /dev/null +++ b/db/migrate/20201007183139_add_gang_relation_to_homies.rb @@ -0,0 +1,5 @@ +class AddGangRelationToHomies < ActiveRecord::Migration[5.2] + def change + add_reference :homies, :gang + end +end \ No newline at end of file diff --git a/db/migrate/20201007213411_add_initial_gang_and_connect_to_homies.rb b/db/migrate/20201007213411_add_initial_gang_and_connect_to_homies.rb new file mode 100644 index 0000000..93e25aa --- /dev/null +++ b/db/migrate/20201007213411_add_initial_gang_and_connect_to_homies.rb @@ -0,0 +1,16 @@ +class AddInitialGangAndConnectToHomies < ActiveRecord::Migration[5.2] + def up + if Gang.count.zero? + Gang.create(name: 'Default').save + elsif Gang.count == 1 + Gang.update name: 'Default' + end + gang = Gang.first + + Homie.all.update(gang: gang) + end + + def down + Homie.all.update(gang: nil) + end +end \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index e1a270a..80897d6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_10_06_120951) do +ActiveRecord::Schema.define(version: 2020_10_07_213411) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -35,12 +35,26 @@ ActiveRecord::Schema.define(version: 2020_10_06_120951) do t.index ["name"], name: "index_chips_on_name", unique: true end + create_table "gangs", force: :cascade do |t| + t.text "chip_name" + t.text "chip_code" + t.text "chip_symbol" + t.boolean "chip_prefixed" + t.integer "chip_scale" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "name" + t.text "about" + end + create_table "homies", force: :cascade do |t| t.text "name", null: false t.integer "importance", default: 100, null: false t.text "about" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.bigint "gang_id" + t.index ["gang_id"], name: "index_homies_on_gang_id" end create_table "money_moves", force: :cascade do |t| @@ -51,16 +65,6 @@ ActiveRecord::Schema.define(version: 2020_10_06_120951) do t.datetime "updated_at", null: false end - create_table "original_gangstas", force: :cascade do |t| - t.text "chip_name" - t.text "chip_code" - t.text "chip_symbol" - t.boolean "chip_prefixed" - t.integer "chip_scale" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - create_table "work", force: :cascade do |t| t.text "description" t.integer "amount"