New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 80568


Ignore:
Timestamp:
07/14/11 22:49:56 (4 years ago)
Author:
derek@…
Message:

Add user model, update os_statistics model and views to reflect replacement of uuid column with user_id

  • Added model/user.rb for Users table
  • os_statistic.rb: changed uuid to user_id - added belong_to user relationship
  • index.html.erb view updated to show user_id instead of uuid
  • show.html.erb no longer displays uuid
Location:
branches/gsoc11-statistics/stats-server/app
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc11-statistics/stats-server/app/models/os_statistic.rb

    r80511 r80568  
    11class OsStatistic < ActiveRecord::Base 
    2   attr_accessible :uuid  
     2  belongs_to :user 
     3   
     4  attr_accessible :user_id 
    35  attr_accessible :macports_version 
    46  attr_accessible :osx_version 
     
    911  attr_accessible :xcode_version 
    1012   
    11   validates :uuid,              :presence => true 
     13  validates :user_id,           :presence => true 
    1214  validates :macports_version,  :presence => true 
    1315  validates :osx_version,       :presence => true 
  • branches/gsoc11-statistics/stats-server/app/views/os_statistics/index.html.erb

    r80511 r80568  
    121121        <tr> 
    122122                <th> ID </th> 
    123                 <th> UUID </th> 
     123                <th> user_id </th> 
    124124                <th> MacPorts Version</th> 
    125125                <th> OSX Version</th> 
     
    135135  <tr> 
    136136    <td> <%= row.id %> </td> 
    137                 <td> <%= row.uuid %> </td> 
     137                <td> <%= row.user_id %> </td> 
    138138                <td> <%= row.macports_version %> </td> 
    139139                <td> <%= row.osx_version %></td> 
  • branches/gsoc11-statistics/stats-server/app/views/os_statistics/show.html.erb

    r80511 r80568  
    1 <p>UUID: <%= @os_stats.uuid %></p> 
    2  
    31<p> macports_version: <%= @os_stats.macports_version %> </p> 
    42<p> osx_version:      <%= @os_stats.osx_version %></p> 
Note: See TracChangeset for help on using the changeset viewer.