Skip to content

Commit

Permalink
Fixed all the deprecation warnings due to implicit globals in views a…
Browse files Browse the repository at this point in the history
…t the cost of some possibly unnecessary assignments
  • Loading branch information
Jonathon Brenner committed Nov 29, 2008
1 parent 0603ff9 commit 688d30a
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion app/views/blogs/_blog.html.erb
@@ -1,6 +1,6 @@
<%
#locals
blog ||= @blog
blog = @blog

%>

Expand Down
2 changes: 1 addition & 1 deletion app/views/blogs/_form.html.erb
@@ -1,6 +1,6 @@
<%
#locals
blog ||= @blog
blog = @blog
%>


Expand Down
2 changes: 1 addition & 1 deletion app/views/blogs/_history.html.erb
@@ -1,6 +1,6 @@
<%
#locals
blogs ||= @blogs
blogs = @blogs
@count = blogs.total_entries

unless blogs.empty?
Expand Down
2 changes: 1 addition & 1 deletion app/views/blogs/_list.html.erb
@@ -1,6 +1,6 @@
<%-
#locals
profile ||= @profile
profile = @profile
size ||= 10
blogs ||= profile.blogs.find :all, :limit => size

Expand Down
2 changes: 1 addition & 1 deletion app/views/comments/_comment.html.erb
@@ -1,5 +1,5 @@
<%-
comment ||= @comment
comment = @comment
truncate = truncate.nil? ? true : truncate


Expand Down
2 changes: 1 addition & 1 deletion app/views/comments/_form.html.erb
@@ -1,6 +1,6 @@
<%
#locals
comment ||= @comment
comment = @comment
%>

<div id="new_comment" class="hidden">
Expand Down
6 changes: 3 additions & 3 deletions app/views/comments/_list.html.erb
@@ -1,12 +1,12 @@
<%-
profile ||= @profile
profile = @profile
with_form ||= false
with_wall_to_wall ||= false

comments ||= @comments
comments = @comments
@count = comments.total_entries

parent ||= @parent
parent = @parent
parent = @blog || @profile || nil
-%>

Expand Down
6 changes: 3 additions & 3 deletions app/views/comments/index.html.erb
@@ -1,8 +1,8 @@
<%
#locals
comments ||= @comments
parent ||= @parent
profile ||= @profile
comments = @comments
parent = @parent
profile = @profile

@count = comments.total_entries
%>
Expand Down
6 changes: 3 additions & 3 deletions app/views/comments/index.rss.builder
@@ -1,7 +1,7 @@
#locals
comments ||= @comments
parent ||= @parent
profile ||= @profile
comments = @comments
parent = @parent
profile = @profile



Expand Down
2 changes: 1 addition & 1 deletion app/views/feed_items/_friend.html.erb
@@ -1,6 +1,6 @@
<%-
#locals
feed_item ||= @feed_item
feed_item = @feed_item



Expand Down
2 changes: 1 addition & 1 deletion app/views/forum_posts/_form.html.erb
@@ -1,6 +1,6 @@
<%
#locals
post ||= @post || @topic.posts.build
post = @post || @topic.posts.build
css_class ||= ''

url = post.new_record? ? forum_topic_posts_url(post.topic.forum, post.topic) : forum_topic_post_url(post.topic.forum, post.topic, post)
Expand Down
2 changes: 1 addition & 1 deletion app/views/forum_posts/_list.html.erb
@@ -1,6 +1,6 @@
<%-
#locals
profile ||= @profile
profile = @profile
size ||= 10
posts ||= profile.forum_posts.find :all, :limit => size

Expand Down
2 changes: 1 addition & 1 deletion app/views/forum_topics/_form.html.erb
@@ -1,6 +1,6 @@
<%
#locals
topic ||= @topic || @forum.topic.build
topic = @topic || @forum.topic.build

url = topic.new_record? ? forum_topics_path(@forum) : forum_topic_path(topic.forum, topic)
%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/forums/_form.html.erb
@@ -1,5 +1,5 @@
<%
forum ||= @forum
forum = @forum
%>
<% less_remote_form_for(forum) do |f| %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/friends/_list.html.erb
@@ -1,5 +1,5 @@
<%
profile ||= @profile
profile = @profile
type ||= 'friends'
size ||= 20
list = profile.send(type).find(:all, :limit => size, :order => 'RANDOM()') rescue []
Expand Down
4 changes: 2 additions & 2 deletions app/views/messages/_form.html.erb
@@ -1,8 +1,8 @@
<%
#locals
message ||= @message
message = @message
message ||= Message.new params[:message]
to_list ||= @to_list
to_list = @to_list
to_list ||= [@profile] #used on someone's profile page
hide_header ||= false

Expand Down
2 changes: 1 addition & 1 deletion app/views/messages/_list.html.erb
@@ -1,6 +1,6 @@
<%-
#locals
list ||= @list
list = @list
sub ||= 'inbox'
label ||= 'Inbox Messages'
sent = params[:action]=='sent'
Expand Down
4 changes: 2 additions & 2 deletions app/views/messages/_message.html.erb
@@ -1,7 +1,7 @@
<%
#locals
message ||= @message
to_list ||= @to_list
message = @message
to_list = @to_list
%>


Expand Down
4 changes: 2 additions & 2 deletions app/views/photos/_gallery.html.erb
@@ -1,8 +1,8 @@
<%-
# Locals
mini ||= false
profile ||= @profile
photos ||= @photos
profile = @profile
photos = @photos

if mini
size ||= 8
Expand Down
2 changes: 1 addition & 1 deletion app/views/photos/_photo.html.erb
@@ -1,7 +1,7 @@
<%
#locals
photo ||= wall
photo ||= @photo
photo = @photo
%>

<div class="left image">
Expand Down
2 changes: 1 addition & 1 deletion app/views/profiles/_bio.html.erb
@@ -1,5 +1,5 @@
<%
profile ||= @profile
profile = @profile
%>
<div class="activity_box learn">
<div class="left avatar"><%= icon profile, :big %></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/profiles/_recent_activity.html.erb
@@ -1,6 +1,6 @@
<%-
#locals
feed_items ||= @feed_items
feed_items = @feed_items

-%>
Expand Down

0 comments on commit 688d30a

Please sign in to comment.