From: Martyn Taylor <[email protected]>
---
src/app/models/hardware_profile.rb | 5 ++++-
src/app/views/users/index.haml | 4 +++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/app/models/hardware_profile.rb
b/src/app/models/hardware_profile.rb
index f6dead3..d5f66eb 100644
--- a/src/app/models/hardware_profile.rb
+++ b/src/app/models/hardware_profile.rb
@@ -21,7 +21,10 @@
class HardwareProfile < ActiveRecord::Base
has_many :instances
+
+ named_scope :frontend, :conditions => { :provider_id => nil }
named_scope :frontend, :conditions => { :provider_id => nil }
+
has_many :provider_instances, :class_name => "Instance",
:foreign_key => "provider_hardware_profile_id"
@@ -104,7 +107,7 @@ class HardwareProfile < ActiveRecord::Base
def self.matching_hwps(hwp)
matching_hwps = []
- provider_hwps = HardwareProfile.find_by_sql("SELECT * FROM
hardware_profiles WHERE provider_id IS NOT NULL")
+ provider_hwps = HardwareProfile.all(:conditions => 'provider_id IS NOT
NULL')
provider_hwps.each do |phwp|
if check_properties(hwp, phwp)
diff --git a/src/app/views/users/index.haml b/src/app/views/users/index.haml
index d0a5d7e..8ec3178 100644
--- a/src/app/views/users/index.haml
+++ b/src/app/views/users/index.haml
@@ -26,16 +26,18 @@
=link_to "Quota", users_url(:sort_by => "quota")
%span (Instances)
%th= link_to "e-mail", users_url(:sort_by => "email")
+ %th
[email protected] do |user|
%tr
%td
%input{:name => "user_checkbox", :type => "radio", :value =>
user.id, :id => "user_checkbox_#{user.id}" }
- %td= link_to user.login, {:action => "edit", :id => user.id}
+ %td= link_to user.login, user_path(user)
%td= user.last_name
%td= user.first_name
%td= sprintf("%.2f", user.quota.percentage_used)
%td= Quota.no_limit(user.quota.maximum_running_instances) ?
"Unlimited" : user.quota.maximum_running_instances
%td= user.email
+ %td= link_to "edit", edit_user_path(user)
:javascript
$(document).ready(function () {
--
1.7.2.3
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel