Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discard leaves and holidays #1659

Merged
merged 9 commits into from
Jan 31, 2024
Merged

Conversation

prasanthchaduvula
Copy link
Contributor

@prasanthchaduvula prasanthchaduvula commented Jan 29, 2024

What

  • Discard leaves and leave types along with time off entries.
  • Discard holidays and holiday info along with time off entries
  • Updated the leave management calculations

@JijoBose JijoBose requested review from nisusam and removed request for JijoBose January 29, 2024 11:05
has_many :holiday_infos, dependent: :destroy
belongs_to :company

enum time_period_optional_holidays: { per_quarter: 0, per_year: 1, per_month: 2, per_week: 3 }

validates :year, presence: true, uniqueness: { scope: :company_id }
validates :year, numericality: { only_integer: true, greater_than_or_equal_to: 1900, less_than_or_equal_to: 2099 }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add default_scope

default_scope -> { kept }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vipulnsward Can we add default scopes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We avoid default scope as much as possible.

Copy link
Contributor

@nisusam nisusam Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. Thanks for confirmation @vipulnsward.
@prasanthchaduvula Rest looks good to me.

Copy link
Contributor

@nisusam nisusam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Add default_scope -> { kept } in respective models.

@prasanthchaduvula prasanthchaduvula merged commit 537cc8c into develop Jan 31, 2024
1 check passed
@prasanthchaduvula prasanthchaduvula deleted the fix-leave-type-errors branch January 31, 2024 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants