Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:railsmachine/xtt

Conflicts:
	app/models/status.rb
	config/environment.rb
	db/schema.rb
  • Loading branch information...
commit b1c862f9ee44e42e547b5097880998ab22210c80 2 parents 96ca264 + 9f918e3
@skalnik skalnik authored
View
11 app/models/status.rb
@@ -2,6 +2,11 @@
class Status < ActiveRecord::Base
include Twitter::Autolink
+<<<<<<< HEAD
+=======
+ include Twitter::Extractor
+
+>>>>>>> 9f918e3523302520a67df12f8597d0c6e25617d6
validate :set_project_from_code
validates_presence_of :user_id, :message
validate :times_are_sane
@@ -19,6 +24,8 @@ class Status < ActiveRecord::Base
after_create :cache_user_status
after_create :process_previous
+ before_save :render_message
+
include AASM
aasm_initial_state :pending
@@ -29,8 +36,8 @@ class Status < ActiveRecord::Base
transitions :from => :pending, :to => :processed, :guard => :calculate_hours
end
- def linked_message
- auto_link self.message
+ def render_message
+ self['rendered'] = auto_link self.message, { :hashtag_url_base => "/hashtags/" }
end
def membership
View
4 app/views/contexts/show.html.erb
@@ -46,9 +46,9 @@
<% else %>
<%= link_to_filtered_statuses h(status.project.name), :context => nil, :project => status.project %> /
<% end %>
- <%= link_to(status_for(status), status, :class => 'entry-title entry-content') %>
+ <%= status.rendered %>
</h4>
- <p class="quiet">posted by <%= link_to(h(status.user.login), status.user) %>, <%= status_at status %> from <strong><%=h status.source || "the web" %></strong></p>
+ <p class="quiet">posted by <%= link_to(h(status.user.login), status.user) %>, <%= link_to status_at(status), status %> from <strong><%=h status.source || "the web" %></strong></p>
<% if status.processed? -%>
<span class="others">
<span class="num"><%= status.hours.to_f %></span>
View
2  app/views/projects/_form.html.erb
@@ -8,7 +8,7 @@
<p>
<label for="project_code">Default Code for posting to this project?</label>
<span class="at">@</span>
- <%= form.text_field :code, :maxlength => 50 %>
+ <%= form.text_field :code, :maxlength => 50, :size => 10 %>
For example: '@proj' or '@project'
<% unless form.object.new_record? %>
<br />
View
4 app/views/projects/show.html.erb
@@ -52,8 +52,8 @@
<%= link_to gravatar_for(status.user), status.user %>
</div>
<div class="media-content">
- <h4 class="media-title status"><%= link_to(status_for(status), status, :class => 'entry-title entry-content') %></h4>
- <p class="quiet">posted by <%= link_to(h(status.user.login), status.user) %>, <%= status_at status %> from <strong><%=h status.source || "the web" %></strong></p>
+ <h4 class="media-title status"><%= status.rendered %></h4>
+ <p class="quiet">posted by <%= link_to(h(status.user.login), status.user) %>, <%= link_to status_at(status), status %> from <strong><%=h status.source || "the web" %></strong></p>
<% if status.processed? -%>
<span class="others">
<span class="num"><%= status.hours.to_f %></span>
View
4 app/views/users/show.html.erb
@@ -51,9 +51,9 @@
<%= link_to gravatar_for(status.user), status.user %>
</div>
<div class="media-content">
- <h4 class="media-title status"><%= link_to(status_for(status), status, :class => 'entry-title entry-content') %></h4>
+ <h4 class="media-title status"><%= status.rendered %></h4>
<p class="quiet">
- posted <strong><%= status_at status %></strong>
+ posted <strong><%= link_to status_at(status), status %></strong>
from <%=h status.source || "the web" %>
<% if status.project? -%>to <%= link_to_filtered_statuses h(status.project.name), :filter => params[:filter], :date => params[:date], :project => status.project %><% end -%>
</p>
View
16 db/migrate/20100702172625_add_rendered_text_to_status.rb
@@ -0,0 +1,16 @@
+class AddRenderedTextToStatus < ActiveRecord::Migration
+ def self.up
+ add_column :statuses, :rendered, :string
+
+ Status.reset_column_information
+
+ Status.all.each do |status|
+ status.render_message
+ status.save!
+ end
+ end
+
+ def self.down
+ remove_column :statuses, :rendered
+ end
+end
View
1  db/schema.rb
@@ -171,6 +171,7 @@
t.integer "project_id"
t.string "source", :default => "the web"
t.datetime "finished_at"
+ t.string "rendered"
end
add_index "statuses", ["created_at", "user_id"], :name => "index_statuses_on_created_at_and_user_id"
Please sign in to comment.
Something went wrong with that request. Please try again.