Skip to content

Commit

Permalink
update schema
Browse files Browse the repository at this point in the history
  • Loading branch information
JensRavens committed Jan 14, 2025
1 parent 11126bc commit c98eabc
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 234 deletions.
96 changes: 0 additions & 96 deletions app/models/awesome_form.rb

This file was deleted.

4 changes: 2 additions & 2 deletions app/models/sprint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# Table name: sprints
#
# id :uuid not null, primary key
# title :string not null
# sprint_during :daterange not null
# working_days :integer not null
# title :string not null
# working_days :integer default(0), not null
# created_at :datetime not null
# updated_at :datetime not null
#
Expand Down
8 changes: 4 additions & 4 deletions app/models/sprint_feedback.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
# Table name: sprint_feedbacks
#
# id :uuid not null, primary key
# billable_hours :decimal(, )
# billable_hours :decimal(, ) default(0.0), not null
# costs :decimal(, )
# daily_nerd_count :integer
# daily_nerd_count :integer default(0), not null
# daily_nerd_entry_dates :datetime default([]), not null, is an Array
# finished_storypoints :integer default(0), not null
# retro_rating :integer
# retro_text :string
# review_notes :string
# skip_retro :boolean default(FALSE)
# tracked_hours :decimal(, )
# skip_retro :boolean default(FALSE), not null
# tracked_hours :decimal(, ) default(0.0), not null
# turnover :decimal(, )
# created_at :datetime not null
# updated_at :datetime not null
Expand Down
32 changes: 15 additions & 17 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,24 @@
#
# Table name: users
#
# id :uuid not null, primary key
# born_on :date
# email :string default(""), not null
# encrypted_password :string default(""), not null
# first_name :string
# github_handle :string
# hired_on :date
# last_name :string
# nick_name :string
# remember_created_at :datetime
# reset_password_sent_at :datetime
# reset_password_token :string
# roles :string default([]), not null, is an Array
# yearly_holidays :integer default(30), not null
# created_at :datetime not null
# updated_at :datetime not null
# slack_id :string
# id :uuid not null, primary key
# born_on :date
# email :string default(""), not null
# first_name :string
# github_handle :string
# hired_on :date
# last_name :string
# nick_name :string
# roles :string default([]), not null, is an Array
# yearly_holidays :integer default(30), not null
# created_at :datetime not null
# updated_at :datetime not null
# slack_id :string
#

class User < ApplicationRecord
self.ignored_columns = ["encrypted_password", "reset_password_sent_at", "reset_password_token", "remember_created_at"]

scope :alphabetically, -> { order(first_name: :asc) }
scope :with_role, ->(role) { where("? = ANY(users.roles)", role) }
scope :sprinter, -> { with_role("sprinter") }
Expand Down
2 changes: 1 addition & 1 deletion app/policies/user_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def unpaid_vacation?
end

def permitted_attributes
[:first_name, :last_name, :nick_name, :password, :password_confirmation]
[:first_name, :last_name, :nick_name]
end

class Scope < Scope
Expand Down
65 changes: 0 additions & 65 deletions config/locales/devise.en.yml

This file was deleted.

4 changes: 1 addition & 3 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
born_on: Faker::Date.birthday(min_age: 18, max_age: 65),
hired_on: Faker::Date.between(from: "2010-01-01", to: "2023-12-31"),
slack_id: Faker::Alphanumeric.alphanumeric(number: 10),
password: "password",
password_confirmation: "password",
github_handle: ["JensRavens"][i]
)

Expand Down Expand Up @@ -78,4 +76,4 @@
end

logger.debug "Creating admin user..."
User.create!(email: "admin@nerdgeschoss.de", password: "password", roles: [:hr, :sprinter])
User.create!(email: "admin@nerdgeschoss.de", roles: [:hr, :sprinter])
8 changes: 4 additions & 4 deletions spec/fixtures/sprint_feedbacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
# Table name: sprint_feedbacks
#
# id :uuid not null, primary key
# billable_hours :decimal(, )
# billable_hours :decimal(, ) default(0.0), not null
# costs :decimal(, )
# daily_nerd_count :integer
# daily_nerd_count :integer default(0), not null
# daily_nerd_entry_dates :datetime default([]), not null, is an Array
# finished_storypoints :integer default(0), not null
# retro_rating :integer
# retro_text :string
# review_notes :string
# skip_retro :boolean default(FALSE)
# tracked_hours :decimal(, )
# skip_retro :boolean default(FALSE), not null
# tracked_hours :decimal(, ) default(0.0), not null
# turnover :decimal(, )
# created_at :datetime not null
# updated_at :datetime not null
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/sprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Table name: sprints
#
# id :uuid not null, primary key
# title :string not null
# sprint_during :daterange not null
# working_days :integer not null
# title :string not null
# working_days :integer default(0), not null
# created_at :datetime not null
# updated_at :datetime not null
#
Expand Down
30 changes: 13 additions & 17 deletions spec/fixtures/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@
#
# Table name: users
#
# id :uuid not null, primary key
# born_on :date
# email :string default(""), not null
# encrypted_password :string default(""), not null
# first_name :string
# github_handle :string
# hired_on :date
# last_name :string
# nick_name :string
# remember_created_at :datetime
# reset_password_sent_at :datetime
# reset_password_token :string
# roles :string default([]), not null, is an Array
# yearly_holidays :integer default(30), not null
# created_at :datetime not null
# updated_at :datetime not null
# slack_id :string
# id :uuid not null, primary key
# born_on :date
# email :string default(""), not null
# first_name :string
# github_handle :string
# hired_on :date
# last_name :string
# nick_name :string
# roles :string default([]), not null, is an Array
# yearly_holidays :integer default(30), not null
# created_at :datetime not null
# updated_at :datetime not null
# slack_id :string
#
john: &john
email: john@example.com
Expand Down
8 changes: 4 additions & 4 deletions spec/models/sprint_feedback_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
# Table name: sprint_feedbacks
#
# id :uuid not null, primary key
# billable_hours :decimal(, )
# billable_hours :decimal(, ) default(0.0), not null
# costs :decimal(, )
# daily_nerd_count :integer
# daily_nerd_count :integer default(0), not null
# daily_nerd_entry_dates :datetime default([]), not null, is an Array
# finished_storypoints :integer default(0), not null
# retro_rating :integer
# retro_text :string
# review_notes :string
# skip_retro :boolean default(FALSE)
# tracked_hours :decimal(, )
# skip_retro :boolean default(FALSE), not null
# tracked_hours :decimal(, ) default(0.0), not null
# turnover :decimal(, )
# created_at :datetime not null
# updated_at :datetime not null
Expand Down
4 changes: 2 additions & 2 deletions spec/models/sprint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# Table name: sprints
#
# id :uuid not null, primary key
# title :string not null
# sprint_during :daterange not null
# working_days :integer not null
# title :string not null
# working_days :integer default(0), not null
# created_at :datetime not null
# updated_at :datetime not null
#
Expand Down
Loading

0 comments on commit c98eabc

Please sign in to comment.