myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2610] trunk/app: changed counting calls to those


From: noreply
Subject: [myexperiment-hackers] [2610] trunk/app: changed counting calls to those still available in rails 3 and later versions of rails 2
Date: Mon, 27 Jun 2011 07:17:09 -0400 (EDT)

Revision
2610
Author
dgc
Date
2011-06-27 07:17:08 -0400 (Mon, 27 Jun 2011)

Log Message

changed counting calls to those still available in rails 3 and later versions of rails 2

Modified Paths

Diff

Modified: trunk/app/models/pack.rb (2609 => 2610)


--- trunk/app/models/pack.rb	2011-06-27 11:15:17 UTC (rev 2609)
+++ trunk/app/models/pack.rb	2011-06-27 11:17:08 UTC (rev 2610)
@@ -45,7 +45,7 @@
            :dependent => :destroy
   
   def items_count
-    return contributable_entries_count + remote_entries_count
+    return contributable_entries.count + remote_entries.count
   end
   
   # returns packs that have largest total number of items

Modified: trunk/app/views/blobs/_table.rhtml (2609 => 2610)


--- trunk/app/views/blobs/_table.rhtml	2011-06-27 11:15:17 UTC (rev 2609)
+++ trunk/app/views/blobs/_table.rhtml	2011-06-27 11:17:08 UTC (rev 2610)
@@ -79,8 +79,8 @@
 						<p style="font-size:85%;"><b>File type: </b><%= h blob.content_type.title %></p>
 						
 						<p style="font-size: 85%;">
-							<a href="" file_path(blob) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(blob.rating, 1) %> / 5 (<%= pluralize blob.ratings_count, 'rating' %>)</a> |
-							<a href="" file_path(blob) + '#comments' -%>"><b>Comments: </b><%= blob.comments_count %></a> |
+							<a href="" file_path(blob) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(blob.rating, 1) %> / 5 (<%= pluralize blob.ratings.count, 'rating' %>)</a> |
+							<a href="" file_path(blob) + '#comments' -%>"><b>Comments: </b><%= blob.comments.count %></a> |
 							<b>Viewed:</b> <%=pluralize blob.contribution.site_viewings_count, "time" %> |
 				      <b>Downloaded:</b> <%=pluralize blob.contribution.site_downloads_count, "time" %>
 						</p>

Modified: trunk/app/views/contributions/_ratings_box.rhtml (2609 => 2610)


--- trunk/app/views/contributions/_ratings_box.rhtml	2011-06-27 11:15:17 UTC (rev 2609)
+++ trunk/app/views/contributions/_ratings_box.rhtml	2011-06-27 11:17:08 UTC (rev 2610)
@@ -1,7 +1,7 @@
 <div class="contribution_section_box">
 	<p class="heading">
 		<%= info_icon_with_tooltip("How does this #{visible_name contributable} rate overall?") %>
-		Ratings <font class="count_text">(<%= contributable.ratings_count -%>)</font>
+		Ratings <font class="count_text">(<%= contributable.ratings.count -%>)</font>
 	  <a name="ratings"></a>
 	</p>
 	
@@ -19,4 +19,4 @@
 			</div>
 		</div>
 	<% end %>
-</div>
\ No newline at end of file
+</div>

Modified: trunk/app/views/contributions/_statistics_box.rhtml (2609 => 2610)


--- trunk/app/views/contributions/_statistics_box.rhtml	2011-06-27 11:15:17 UTC (rev 2609)
+++ trunk/app/views/contributions/_statistics_box.rhtml	2011-06-27 11:17:08 UTC (rev 2610)
@@ -30,13 +30,13 @@
 				
 				<% if favouritable? type -%>
 					<p>
-			      <a href="" pluralize contributable.bookmarks_count, "favourite" -%></a>
+			      <a href="" pluralize contributable.bookmarks.count, "favourite" -%></a>
 			    </p>
 				<% end -%>
 				
 				<% if rateable? type -%>
 					<p>
-			      <a href="" pluralize contributable.ratings_count, "rating" -%></a>
+			      <a href="" pluralize contributable.ratings.count, "rating" -%></a>
 			    </p>
 				<% end -%>
 				
@@ -44,19 +44,19 @@
 					<p>
 			      <!-- for this to work properly, view for every resource that supports citations will need to have -->
 						<!-- tab system with 'tabsContainer' element + anchor called 'citations' -->
-						<a href=""  pluralize contributable.citations_count, "citation" %></a>
+						<a href=""  pluralize contributable.citations.count, "citation" %></a>
 			    </p>
 				<% end %>
 				
 				<% if reviewable? type %>
 					<p>
-			      <a href="" pluralize contributable.reviews_count, "review" -%></a>
+			      <a href="" pluralize contributable.reviews.count, "review" -%></a>
 			    </p>
 				<% end %>
 				
 				<% if commentable? type -%>
 			    <p>
-			    	<a href="" pluralize contributable.comments_count, "comment" -%></a>
+			    	<a href="" pluralize contributable.comments.count, "comment" -%></a>
 			    </p>
 				<% end -%>
 			</div>
@@ -66,4 +66,4 @@
 		
 		
 	</div>
-</div>
\ No newline at end of file
+</div>

Modified: trunk/app/views/packs/_table.rhtml (2609 => 2610)


--- trunk/app/views/packs/_table.rhtml	2011-06-27 11:15:17 UTC (rev 2609)
+++ trunk/app/views/packs/_table.rhtml	2011-06-27 11:17:08 UTC (rev 2610)
@@ -46,7 +46,7 @@
 						</p>
 						
 						<p style="font-size: 85%;">
-							<a href="" pack_path(pack) + '#comments' -%>"><b>Comments: </b><%= pack.comments_count %></a> |
+							<a href="" pack_path(pack) + '#comments' -%>"><b>Comments: </b><%= pack.comments.count %></a> |
 							<b>Viewed:</b> <%=pluralize pack.contribution.site_viewings_count, "time" %> |
 				      <b>Downloaded:</b> <%=pluralize pack.contribution.site_downloads_count, "time" %>
 						</p>

Modified: trunk/app/views/users/show.rhtml (2609 => 2610)


--- trunk/app/views/users/show.rhtml	2011-06-27 11:15:17 UTC (rev 2609)
+++ trunk/app/views/users/show.rhtml	2011-06-27 11:17:08 UTC (rev 2610)
@@ -219,13 +219,13 @@
 					
 					<p>
 			      <b>
-			      	<%= link_to(pluralize(@user.networks_owned_count, "Group") + " (admin)", url_for(:action ="" 'groups')) -%>
+			      	<%= link_to(pluralize(@user.networks_owned.count, "Group") + " (admin)", url_for(:action ="" 'groups')) -%>
 						</b> 
 			    </p>
 					
 					<p>
 			      <b>
-			      	<%= link_to(pluralize(@user.networks_count, "Group") + " (member)", url_for(:action ="" 'groups')) -%>
+			      	<%= link_to(pluralize(@user.networks.length, "Group") + " (member)", url_for(:action ="" 'groups')) -%>
 						</b> 
 			    </p>
 					
@@ -239,7 +239,7 @@
 					
 					<p>
 			      <b>
-			      	<%= link_to(pluralize(@user.bookmarks_count, "Favourite"), url_for(:action ="" 'favourites')) -%>
+			      	<%= link_to(pluralize(@user.bookmarks.count, "Favourite"), url_for(:action ="" 'favourites')) -%>
 						</b> 
 			    </p>
 				</div>	

Modified: trunk/app/views/workflows/_table.rhtml (2609 => 2610)


--- trunk/app/views/workflows/_table.rhtml	2011-06-27 11:15:17 UTC (rev 2609)
+++ trunk/app/views/workflows/_table.rhtml	2011-06-27 11:17:08 UTC (rev 2610)
@@ -98,11 +98,11 @@
             <div style="clear: both"></div>
 
 					  <p style="font-size: 85%;">
-							<a href="" workflow_path(workflow) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(workflow.rating, 1) %> / 5 (<%= pluralize workflow.ratings_count, 'rating' %>)</a> |
-							<a href="" workflow_path(workflow) + '#versions' -%>"><b>Versions: </b><%= workflow.versions_count %></a> |
-							<a href="" workflow_path(workflow) + '#reviews' -%>"><b>Reviews: </b><%= workflow.reviews_count %></a> |
-							<a href="" workflow_path(workflow) + '#comments' -%>"><b>Comments: </b><%= workflow.comments_count %></a> |
-							<a href="" workflow_path(workflow) + '#citations' -%>"><b>Citations: </b><%= workflow.citations_count %></a>
+							<a href="" workflow_path(workflow) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(workflow.rating, 1) %> / 5 (<%= pluralize workflow.ratings.count, 'rating' %>)</a> |
+							<a href="" workflow_path(workflow) + '#versions' -%>"><b>Versions: </b><%= workflow.versions.count %></a> |
+							<a href="" workflow_path(workflow) + '#reviews' -%>"><b>Reviews: </b><%= workflow.reviews.count %></a> |
+							<a href="" workflow_path(workflow) + '#comments' -%>"><b>Comments: </b><%= workflow.comments.count %></a> |
+							<a href="" workflow_path(workflow) + '#citations' -%>"><b>Citations: </b><%= workflow.citations.count %></a>
 					  </p>
 						
 						<p style="font-size: 85%;">

reply via email to

[Prev in Thread] Current Thread [Next in Thread]