Skip to content

Commit

Permalink
add arrived_at to att record, change timezone to EST
Browse files Browse the repository at this point in the history
  • Loading branch information
SophieDeBenedetto committed Oct 25, 2016
1 parent 5a789e6 commit 04ab426
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/serializers/attendance_record_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AttendanceRecordSerializer < ActiveModel::Serializer
attributes :id, :date
attributes :id, :date, :arrived_at, :arrived
has_one :student
end
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ class Application < Rails::Application
# config.middleware.insert_before SelectiveSession, "OmniAuth::Builder"
config.api_only = false
config.autoload_paths << Rails.root.join('lib')
config.time_zone = 'Eastern Time (US & Canada)'
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddArrivedAtToAttendanceRecord < ActiveRecord::Migration[5.0]
def change
add_column :attendance_records, :arrived_at, :datetime
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20161021173224) do
ActiveRecord::Schema.define(version: 20161025213212) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand All @@ -22,6 +22,7 @@
t.boolean "arrived"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "arrived_at"
t.index ["schedule_id"], name: "index_attendance_records_on_schedule_id", using: :btree
t.index ["student_id"], name: "index_attendance_records_on_student_id", using: :btree
end
Expand Down
4 changes: 1 addition & 3 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
c = Cohort.create(name: "web-0717")
binding.pry
25.times do
User.create(first_name: Faker::Name.first_name, last_name: Faker::Name.last_name, email: Faker::Internet.email, github_username: Faker::Internet.user_name, cohort: c)
end
Expand All @@ -8,8 +7,7 @@
["July 4th", "December 25th"].each do |day|
Holiday.create(date: day.to_date)
end
binding.pry

Schedule.create(start_date: Date.today, end_date: Date.today + 90, cohort: Cohort.first)
Schedule.create(start_date: Date.today - 90, end_date: Date.today, cohort: Cohort.first)


0 comments on commit 04ab426

Please sign in to comment.