Modified: branches/event_logging/app/helpers/application_helper.rb (1994 => 1995)
--- branches/event_logging/app/helpers/application_helper.rb 2008-11-20 15:39:20 UTC (rev 1994)
+++ branches/event_logging/app/helpers/application_helper.rb 2008-11-20 15:43:45 UTC (rev 1995)
@@ -1652,7 +1652,7 @@
# user's contributions will contain all workflows/files/packs where the user is original uploader
users_stuff.concat(contributor.contributions.collect { |c_ution| c_ution.contributable })
# workflows, where WF versions uploaded by the user (when they are not the original uploader) - these aren't included into user's contributions
- users_stuff.concat(contributor.workflow_versions)
+ users_stuff.concat(contributor.workflows_with_contributed_versions)
# also, fetch user's favourites
contributor.bookmarks.each do |favourite|
Modified: branches/event_logging/app/models/user.rb (1994 => 1995)
--- branches/event_logging/app/models/user.rb 2008-11-20 15:39:20 UTC (rev 1994)
+++ branches/event_logging/app/models/user.rb 2008-11-20 15:43:45 UTC (rev 1995)
@@ -276,9 +276,9 @@
has_many :workflows, :as => :contributor
has_many :packs, :as => :contributor
- # this returns workflow instances, where the current user is uploader of a version
- # (workflow_versions may overlap with workflows (when the user is uploader of the version AND the original uploader of the workflow))
- has_many :workflow_versions,
+ # returns workflow instances, where the current user is uploader of a version;
+ # (this also includes workflows, where the user is original uploader of the workflow)
+ has_many :workflows_with_contributed_versions,
:class_name => "Workflow",
:finder_sql => 'SELECT * FROM workflows w JOIN workflow_versions v ON w.id = v.workflow_id WHERE v.contributor_type = \'User\' AND v.contributor_id = #{id}'