Skip to content

Commit

Permalink
timepoints added
Browse files Browse the repository at this point in the history
  • Loading branch information
Stepan Boltalin committed Feb 8, 2012
1 parent af35763 commit dad8019
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/models/plot.rb
Expand Up @@ -246,6 +246,10 @@ def self.pull_youtubeids_with_timecodes_with_hash(ytids, search_hash)
end






def self.create_iframes(ytids)
result = Array.new
ytids.each do |y|
Expand Down
6 changes: 6 additions & 0 deletions app/views/plots/show.html.erb
Expand Up @@ -47,6 +47,12 @@
</p>


<p>
<b>Timepoints:</b><br />
<%= @plot.timepoint %>
</p>


<% end %>
<%= link_to 'Edit', edit_plot_path(@plot) %> |
Expand Down
1 change: 1 addition & 0 deletions app/workers/plot_creator.rb
Expand Up @@ -20,6 +20,7 @@ def self.perform(plot_id)
@plot.youtubeid = (Plot.create_youtubelinks(youtubeids))
@plot.content = (Plot.create_iframes(youtubeids))
@plot.chosen_word = words
@plot.timepoint = youtubeids
@plot.sentiment_value = Plot.find_sentiment_value(words)
@plot.save
end
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20120207234322_add_timepoint_to_plots.rb
@@ -0,0 +1,5 @@
class AddTimepointToPlots < ActiveRecord::Migration
def change
add_column :plots, :timepoint, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20120118000502) do
ActiveRecord::Schema.define(:version => 20120207234322) do

create_table "comments", :force => true do |t|
t.text "content", :limit => 255
Expand Down Expand Up @@ -99,6 +99,7 @@
t.text "youtubeid"
t.text "chosen_word", :limit => 255, :default => "'--- []\n'"
t.float "sentiment_value"
t.string "timepoint"
end

create_table "user_sessions", :force => true do |t|
Expand Down

0 comments on commit dad8019

Please sign in to comment.