Skip to content

Commit

Permalink
Expose attribute_aliases as attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrock committed Jan 30, 2025
1 parent 037fd1f commit 6e92c8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def self.ar_model_associations

def self.expose_class_attributes(subclass)
subclass.class_eval do
model.attribute_names.each do |attr|
(model.attribute_names | model.try(:attribute_aliases)&.keys).each do |attr|
next if model.private_method_defined?(attr)
next if EXPOSED_ATTR_BLACK_LIST.any? { |rexp| attr =~ rexp }
next if subclass.base_class != self && method_defined?(attr)
Expand Down
1 change: 1 addition & 0 deletions spec/service_models/miq_ae_service_flavor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
expect(@service_flavor.name).to eq("small")
expect(@service_flavor.description).to eq("really small")
expect(@service_flavor.cpus).to eq(1)
expect(@service_flavor.cpu_total_cores).to eq(1)
expect(@service_flavor.memory).to eq(2.gigabytes)
expect(@service_flavor).to be_kind_of(MiqAeMethodService::MiqAeServiceFlavor)
end
Expand Down

0 comments on commit 6e92c8e

Please sign in to comment.