Iker Narvaez

rename tables

class PoolsController < CrudController::Base
enable_gatekeeper
guard_bifrost
end
# frozen_string_literal: true
# == Schema Information
#
# Table name: heimdall_engine_roles
#
# id :integer not null, primary key
# name :string
# created_at :datetime
# updated_at :datetime
# deleted_at :datetime
# erasable :boolean
#
class Pool < ApplicationRecord
validates :name, :editable_unitl, presence: true
has_many :matches, dependent: :destroy, inverse_of: :pool
accepts_nested_attributes_for :matches, reject_if: :all_blank,
allow_destroy: true
end
......@@ -2,4 +2,6 @@ Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
HeimdallEngine.load_routes
root 'application#root'
resources :pools
end
......
class CreateProject < ActiveRecord::Migration[5.0]
def change
create_table :match do |t|
create_table :matches do |t|
t.string :local, null: false
t.string :visit, null: false
t.date :date, null: false
......@@ -10,13 +10,13 @@ class CreateProject < ActiveRecord::Migration[5.0]
t.integer :pool_id, null: false
end
create_table :pool do |t|
create_table :pools do |t|
t.string :name, null: false
t.datetime :editable_until, null: false
t.boolean :active
end
create_table :bet do |t|
create_table :bets do |t|
t.integer :match_id, null: false
t.integer :user_id, null: false
t.integer :score_local, null: false
......