lib/manageiq/api/client/collection.rb in manageiq-api-client-0.2.0 vs lib/manageiq/api/client/collection.rb in manageiq-api-client-0.3.0
- old
+ new
@@ -93,20 +93,20 @@
end
private
def method_missing(sym, *args, &block)
- get unless actions_present?
+ query_actions unless actions_present?
if action_defined?(sym)
exec_action(sym, *args, &block)
else
super
end
end
def respond_to_missing?(sym, *_)
- get unless actions_present?
+ query_actions unless actions_present?
action_defined?(sym) || super
end
def parameters_from_query_relation(options)
api_params = {}
@@ -191,9 +191,14 @@
end
elsif args.present?
body[args.kind_of?(Array) ? "resources" : "resource"] = args
end
body
+ end
+
+ def query_actions
+ result_hash = client.get(name, :limit => 1)
+ fetch_actions(result_hash)
end
end
end
end
end