31 lines
1.1 KiB
Ruby
31 lines
1.1 KiB
Ruby
module EmployerAutomation
|
|
extend ActiveSupport::Concern
|
|
|
|
# included do
|
|
# # Code in this block becomes instance methods or class macros (like scopes, validations, associations) in the including class.
|
|
# scope :visible, -> { where(visible: true) }
|
|
# scope :invisible, -> { where(visible: false) }
|
|
# validates :status, inclusion: { in: %w(visible invisible), message: "%{value} is not a valid status" }
|
|
# end
|
|
|
|
# class_methods do
|
|
# # Methods in this block become class methods of the including class.
|
|
# def count_all_visible
|
|
# visible.count
|
|
# end
|
|
# end
|
|
|
|
# Any other methods defined here become instance methods automatically.
|
|
def up_to_date?
|
|
self.pl_plan_key.present? &&
|
|
self.company_pb_entity_key.present? &&
|
|
self.plan_id.present? &&
|
|
self.group_number.present? &&
|
|
self.effect_date.present?
|
|
end
|
|
|
|
def sync_with_vhcs
|
|
sql_query = "SELECT PLPlanKey, PlanId, ShortDesc FROM PLPlanHeader WHERE ActiveInactive = 'Active' And PLPlanKey = 57"
|
|
plan_header = VhcsRecord.connection.select_all(sql_query).first
|
|
end
|
|
end |