Skip to content

Commit

Permalink
secondary_actor => secondary_subject
Browse files Browse the repository at this point in the history
  • Loading branch information
webmat committed Feb 19, 2009
1 parent 36d722a commit e044441
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
5 changes: 0 additions & 5 deletions generators/timeline_event/templates/model.rb

This file was deleted.

File renamed without changes.
@@ -1,8 +1,8 @@
class CreateTimelineEvents < ActiveRecord::Migration
def self.up
create_table :timeline_events do |t|
t.string :event_type, :subject_type, :actor_type, :secondary_actor_type
t.integer :subject_id, :actor_id, :secondary_actor_id
t.string :event_type, :subject_type, :actor_type, :secondary_subject_type
t.integer :subject_id, :actor_id, :secondary_subject_id
t.timestamps
end
end
Expand Down
5 changes: 5 additions & 0 deletions generators/timeline_fu/templates/model.rb
@@ -0,0 +1,5 @@
class TimelineEvent < ActiveRecord::Base
belongs_to :subject, :polymorphic => true
belongs_to :actor, :polymorphic => true
belongs_to :secondary_subject, :polymorphic => true
end
2 changes: 1 addition & 1 deletion lib/timeline_fu/fires.rb
Expand Up @@ -15,7 +15,7 @@ def fires(event_type, opts)
raise MissingOnArgument.new(opts) unless opts.has_key?(:on)
method_name = :"fire_#{event_type}_after_#{opts[:on]}"
define_method(method_name) do
create_options = [:subject, :actor, :secondary_actor].inject({}) do |memo, sym|
create_options = [:actor, :subject, :secondary_subject].inject({}) do |memo, sym|
memo[sym] = send(opts[sym]) if opts[sym]
memo
end
Expand Down

0 comments on commit e044441

Please sign in to comment.