Skip to content

Instantly share code, notes, and snippets.

@ryanvermooten
Created June 5, 2014 12:07
Show Gist options
  • Select an option

  • Save ryanvermooten/0e75f4fe689f8a6c8107 to your computer and use it in GitHub Desktop.

Select an option

Save ryanvermooten/0e75f4fe689f8a6c8107 to your computer and use it in GitHub Desktop.
class GroupsTrainer < ActiveRecord::Base
attr_accessible :area, :name, :trainer_id
belongs_to :trainer
has_many :home_gardeners
end
class HomeGardener < Account
# belongs_to :survey
#belongs_to :group
# has_many_and_belongs_to :attendance_registers
end
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140605114152) do
create_table "accounts", :force => true do |t|
t.string "type"
t.string "first_name"
t.string "last_name"
t.string "cell_number"
t.string "home_address"
t.string "garden_address"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "home_gardeners", :force => true do |t|
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "trainers", :force => true do |t|
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "groups_trainer", :force => true do |t|
t.string "name"
t.string "area"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "trainer_id"
end
class Trainer < Account
attr_accessible :id, :type
has_and_belongs_to_many :trainer_groups
# has_many :home_gardeners, through: :trainer_groups
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment