Skip to content

Commit

Permalink
WIP Remove virtual columns on alias_attribute(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafanie committed Jan 30, 2025
1 parent 11d3631 commit ae95f19
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 8 deletions.
3 changes: 0 additions & 3 deletions app/models/flavor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ class Flavor < ApplicationRecord
alias_attribute :cpus, :cpu_total_cores
alias_attribute :cpu_cores, :cpu_cores_per_socket

virtual_column :cpus, :type => :integer
virtual_column :cpu_cores, :type => :integer

def name_with_details
details = if cpus == 1
if root_disk_size.nil?
Expand Down
1 change: 1 addition & 0 deletions app/models/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class Host < ApplicationRecord

serialize :settings, :type => Hash

# TODO: virtual alias?
deprecate_attribute :address, :hostname, :type => :string
alias_attribute :state, :power_state
alias_attribute :to_s, :name
Expand Down
1 change: 0 additions & 1 deletion app/models/miq_provision.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class MiqProvision < MiqProvisionTask
virtual_belongs_to :vm
virtual_belongs_to :vm_template
virtual_column :placement_auto, :type => :boolean
virtual_column :provision_type, :type => :string # Legacy provisioning support

scope :with_miq_request_id, ->(request_id) { where(:miq_request_id => request_id) }

Expand Down
2 changes: 0 additions & 2 deletions app/models/miq_provision_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class MiqProvisionRequest < MiqRequest
default_value_for(:source_id) { |r| r.get_option(:src_vm_id) || r.get_option(:source_id) }
default_value_for :source_type, "VmOrTemplate"

virtual_column :provision_type, :type => :string

include MiqProvisionMixin
include MiqProvisionQuotaMixin

Expand Down
1 change: 0 additions & 1 deletion app/models/miq_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class MiqRequest < ApplicationRecord
virtual_column :v_workflow_class, :type => :string, :uses => :workflow
virtual_column :request_type_display, :type => :string
virtual_column :resource_type, :type => :string
virtual_column :state, :type => :string

delegate :allowed_tags, :to => :workflow, :prefix => :v, :allow_nil => true
delegate :class, :to => :workflow, :prefix => :v_workflow
Expand Down
1 change: 1 addition & 0 deletions app/models/miq_schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class MiqSchedule < ApplicationRecord
include Filters

include YamlImportExportMixin
# TODO: towhat is a virtual alias?
deprecate_attribute :towhat, :resource_type, :type => :string

validates :name, :uniqueness_when_changed => {:scope => [:userid, :resource_type]}
Expand Down
1 change: 1 addition & 0 deletions app/models/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class Service < ApplicationRecord
alias_method :service, :parent
alias_method :service=, :parent=

# TODO: virtual alias?
deprecate_attribute :display, :visible, :type => :boolean
virtual_belongs_to :service

Expand Down
1 change: 0 additions & 1 deletion app/models/tenant_quota.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class TenantQuota < ApplicationRecord
scope :templates_allocated, -> { where(:name => :templates_allocated) }

virtual_column :name, :type => :string
virtual_column :total, :type => :integer
virtual_column :used, :type => :float
virtual_column :allocated, :type => :float
virtual_column :available, :type => :float
Expand Down

0 comments on commit ae95f19

Please sign in to comment.