lib/gitlab/license.rb in gitlab-license-2.5.0 vs lib/gitlab/license.rb in gitlab-license-2.6.0

- old
+ new

@@ -77,11 +77,11 @@ attr_accessor :licensee, :starts_at, :expires_at, :notify_admins_at, :notify_users_at, :block_changes_at, :last_synced_at, :next_sync_at, :activated_at, :restrictions, :cloud_licensing_enabled, :offline_cloud_licensing_enabled, :auto_renew_enabled, :seat_reconciliation_enabled, :operational_metrics_enabled, :generated_from_customers_dot, - :generated_from_cancellation, :temporary_extension + :generated_from_cancellation, :temporary_extension, :contract_overages_allowed alias_method :issued_at, :starts_at alias_method :issued_at=, :starts_at= def initialize(attributes = {}) @@ -168,10 +168,14 @@ def offline_cloud_licensing? offline_cloud_licensing_enabled == true end + def contract_overages_allowed? + contract_overages_allowed == true + end + def auto_renew? auto_renew_enabled == true end def seat_reconciliation? @@ -232,10 +236,11 @@ hash['cloud_licensing_enabled'] = cloud_licensing? hash['offline_cloud_licensing_enabled'] = offline_cloud_licensing? hash['auto_renew_enabled'] = auto_renew? hash['seat_reconciliation_enabled'] = seat_reconciliation? hash['operational_metrics_enabled'] = operational_metrics? + hash['contract_overages_allowed'] = contract_overages_allowed? hash['generated_from_customers_dot'] = generated_from_customers_dot? hash['generated_from_cancellation'] = generated_from_cancellation? hash['temporary_extension'] = temporary_extension? @@ -291,9 +296,11 @@ generated_from_cancellation temporary_extension ].each do |attr_name| public_send("#{attr_name}=", attributes[attr_name] == true) end + + @contract_overages_allowed = attributes['contract_overages_allowed'] != false restrictions = attributes['restrictions'] if restrictions&.is_a?(Hash) restrictions = restrictions.transform_keys(&:to_sym) @restrictions = restrictions