myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2908] branches/datasets: Merged trunk 2857:2907


From: noreply
Subject: [myexperiment-hackers] [2908] branches/datasets: Merged trunk 2857:2907 into datasets branch
Date: Thu, 19 Jan 2012 05:38:37 -0500 (EST)

Revision
2908
Author
fbacall
Date
2012-01-19 05:38:36 -0500 (Thu, 19 Jan 2012)

Log Message

Merged trunk 2857:2907 into datasets branch

Modified Paths

Added Paths

Removed Paths

Diff

Modified: branches/datasets/Rakefile (2907 => 2908)


--- branches/datasets/Rakefile	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/Rakefile	2012-01-19 10:38:36 UTC (rev 2908)
@@ -156,3 +156,23 @@
   ActiveRecord::Base.record_timestamps = true
 end
 
+desc 'Assign categories to content types'
+task "myexp:types:assign_categories" do
+  require File.dirname(__FILE__) + '/config/environment'
+
+  workflow_content_types = Workflow.find(:all).group_by do |w| w.content_type_id end.keys
+
+  ContentType.find(:all).each do |content_type|
+
+    next if content_type.category
+
+    if workflow_content_types.include?(content_type.id)
+      category = "Workflow"
+    else
+      category = "Blob"
+    end
+
+    content_type.update_attribute("category", category)
+  end
+end
+

Modified: branches/datasets/app/controllers/blobs_controller.rb (2907 => 2908)


--- branches/datasets/app/controllers/blobs_controller.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/controllers/blobs_controller.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -87,10 +87,10 @@
     respond_to do |format|
       format.html {
 
-        @lod_nir  = file_url(@blob)
-        @lod_html = file_url(:id => @blob.id, :format => 'html')
-        @lod_rdf  = file_url(:id => @blob.id, :format => 'rdf')
-        @lod_xml  = file_url(:id => @blob.id, :format => 'xml')
+        @lod_nir  = blob_url(@blob)
+        @lod_html = blob_url(:id => @blob.id, :format => 'html')
+        @lod_rdf  = blob_url(:id => @blob.id, :format => 'rdf')
+        @lod_xml  = blob_url(:id => @blob.id, :format => 'xml')
 
         # show.rhtml
       }
@@ -136,7 +136,7 @@
       @blob.content_type = ContentType.find_by_mime_type(content_type)
 
       if @blob.content_type.nil?
-        @blob.content_type = ContentType.create(:user_id => current_user.id, :mime_type => content_type, :title => content_type)
+        @blob.content_type = ContentType.create(:user_id => current_user.id, :mime_type => content_type, :title => content_type, :category => 'Blob')
       end
 
       respond_to do |format|
@@ -157,7 +157,7 @@
         
           if policy_err_msg.blank?
             flash[:notice] = 'File was successfully created.'
-            format.html { redirect_to file_url(@blob) }
+            format.html { redirect_to blob_url(@blob) }
           else
             flash[:notice] = "File was successfully created. However some problems occurred, please see these below.</br></br><span style='color: red;'>" + policy_err_msg + "</span>"
             format.html { redirect_to :controller => 'blobs', :id => @blob, :action ="" "edit" }
@@ -200,7 +200,7 @@
         
         if policy_err_msg.blank?
           flash[:notice] = 'File was successfully updated.'
-          format.html { redirect_to file_url(@blob) }
+          format.html { redirect_to blob_url(@blob) }
         else
           flash[:error] = policy_err_msg
           format.html { redirect_to :controller => 'blobs', :id => @blob, :action ="" "edit" }
@@ -218,10 +218,10 @@
     respond_to do |format|
       if success
         flash[:notice] = "File has been deleted."
-        format.html { redirect_to files_url }
+        format.html { redirect_to blobs_url }
       else
         flash[:error] = "Failed to delete File. Please contact your administrator."
-        format.html { redirect_to file_url(@blob) }
+        format.html { redirect_to blob_url(@blob) }
       end
     end
   end
@@ -265,11 +265,11 @@
   
   # POST /files/1;favourite
   def favourite
-    @blob.bookmarks << Bookmark.create(:user => current_user) unless @blob.bookmarked_by_user?(current_user)
+    @blob.bookmarks << Bookmark.create(:user => current_user, :bookmarkable => @blob) unless @blob.bookmarked_by_user?(current_user)
     
     respond_to do |format|
       flash[:notice] = "You have successfully added this item to your favourites."
-      format.html { redirect_to file_url(@blob) }
+      format.html { redirect_to blob_url(@blob) }
     end
   end
   
@@ -283,7 +283,7 @@
     
     respond_to do |format|
       flash[:notice] = "You have successfully removed this item from your favourites."
-      redirect_url = params[:return_to] ? params[:return_to] : file_url(@blob)
+      redirect_url = params[:return_to] ? params[:return_to] : blob_url(@blob)
       format.html { redirect_to redirect_url }
     end
   end
@@ -353,7 +353,7 @@
      (err = Blob.new.errors).add(attr, message)
     
     respond_to do |format|
-      format.html { redirect_to files_url }
+      format.html { redirect_to blobs_url }
     end
   end
 end

Modified: branches/datasets/app/controllers/comments_controller.rb (2907 => 2908)


--- branches/datasets/app/controllers/comments_controller.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/controllers/comments_controller.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -13,7 +13,7 @@
     if params[:start] && params[:end]
       begin
         @comments = Comment.find(:all, :conditions => [ "commentable_id = ? AND commentable_type = ? AND created_at > ? AND created_at < ?", @context.id, @context.class.name, params[:start].to_time, params[:end].to_time ] )
-      rescue TypeError
+      rescue TypeError, ArgumentError
       end
     end
     @comments ||= []

Modified: branches/datasets/app/controllers/feedback_controller.rb (2907 => 2908)


--- branches/datasets/app/controllers/feedback_controller.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/controllers/feedback_controller.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -21,8 +21,12 @@
         format.html { redirect_to "/feedback" }
       end
     else
-      if params[:feedback] && captcha_valid?(params[:feedback][:captcha_id], params[:feedback][:captcha_validation])
-    
+      if Conf.recaptcha_enable && !verify_recaptcha(:private_key => Conf.recaptcha_private)
+        respond_to do |format|
+          flash[:error] = 'Your feedback has not been submitted. CAPTCHA was not entered correctly.'
+          format.html { redirect_to "/feedback?from="+String(params[:from])+"&email="+String(params[:email])+"&subject="+String(params[:subject])+"&content="+String(params[:content]) }
+        end
+      else
         from_user = ( params[:from].blank? ? 'no from': params[:from] ) + ' (' + (!params[:email].blank? ? params[:email] : 'no email') + ')';
         Mailer.deliver_feedback(from_user, params[:subject], params[:content])
     
@@ -30,11 +34,6 @@
           flash[:notice] = 'Your feedback has been submitted. Thank you very much.'
           format.html { redirect_to "/feedback" }
         end
-      else
-        respond_to do |format|
-          flash[:error] = 'Your feedback has not been submitted. CAPTCHA was not entered correctly.'
-          format.html { redirect_to "/feedback?from="+String(params[:from])+"&email="+String(params[:email])+"&subject="+String(params[:subject])+"&content="+String(params[:content]) }
-        end
       end
     end
   end

Modified: branches/datasets/app/controllers/group_announcements_controller.rb (2907 => 2908)


--- branches/datasets/app/controllers/group_announcements_controller.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/controllers/group_announcements_controller.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -30,10 +30,10 @@
     respond_to do |format|
       format.html {
 
-        @lod_nir  = group_announcement_url(:id => @announcement.id, :group_id => @announcement.network_id)
-        @lod_html = group_announcement_url(:id => @announcement.id, :group_id => @announcement.network_id, :format => 'html')
-        @lod_rdf  = group_announcement_url(:id => @announcement.id, :group_id => @announcement.network_id, :format => 'rdf')
-        @lod_xml  = group_announcement_url(:id => @announcement.id, :group_id => @announcement.network_id, :format => 'xml')
+        @lod_nir  = group_announcement_url(:id => @announcement.id, :network_id => @announcement.network_id)
+        @lod_html = group_announcement_url(:id => @announcement.id, :network_id => @announcement.network_id, :format => 'html')
+        @lod_rdf  = group_announcement_url(:id => @announcement.id, :network_id => @announcement.network_id, :format => 'rdf')
+        @lod_xml  = group_announcement_url(:id => @announcement.id, :network_id => @announcement.network_id, :format => 'xml')
 
         # show.rhtml
       }
@@ -100,7 +100,7 @@
   
   def find_group
     begin
-      @group = Network.find(params[:group_id])
+      @group = Network.find(params[:network_id])
     rescue ActiveRecord::RecordNotFound
       error("Group couldn't be found")
     end
@@ -171,7 +171,7 @@
 
   def error(message)
     flash[:error] = message
-    return_to_path = @group.nil? ? groups_path : group_announcements_path(@group)
+    return_to_path = @group.nil? ? networks_path : group_announcements_path(@group)
     
     respond_to do |format|
       format.html { redirect_to return_to_path }

Modified: branches/datasets/app/controllers/memberships_controller.rb (2907 => 2908)


--- branches/datasets/app/controllers/memberships_controller.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/controllers/memberships_controller.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -82,7 +82,7 @@
     respond_to do |format|
       if @membership.accept!
         flash[:notice] = 'Membership was successfully accepted.'
-        format.html { redirect_to group_url(@membership.network_id) }
+        format.html { redirect_to network_url(@membership.network_id) }
       else
         error("Membership already accepted", "already accepted")
       end
@@ -324,7 +324,7 @@
 
     respond_to do |format|
       flash[:notice] = "Membership successfully deleted"
-      format.html { redirect_to(params[:return_to] ? params[:return_to] : group_path(network_id)) }
+      format.html { redirect_to(params[:return_to] ? params[:return_to] : network_path(network_id)) }
     end
   end
   

Modified: branches/datasets/app/controllers/networks_controller.rb (2907 => 2908)


--- branches/datasets/app/controllers/networks_controller.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/controllers/networks_controller.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -69,10 +69,10 @@
           end
   
           flash[:notice] = 'An invitation has been sent to the User.'
-          format.html { redirect_to group_url(@network) }
+          format.html { redirect_to network_url(@network) }
         else
           flash[:error] = 'Failed to send invitation to User. Please try again or report this.'
-          format.html { redirect_to invite_group_url(@network) }
+          format.html { redirect_to invite_network_url(@network) }
         end
       end
     else
@@ -82,7 +82,7 @@
         flash[:error] = "User invited is already a member of the group"
       end
       respond_to do |format|
-        format.html { redirect_to invite_group_url(@network) }
+        format.html { redirect_to invite_network_url(@network) }
       end
     end
   end
@@ -90,7 +90,7 @@
   # POST /networks/1;membership_invite_external
   def membership_invite_external
     # first of all, check that captcha was entered correctly
-    if !captcha_valid?(params[:invitations][:captcha_id], params[:invitations][:captcha_validation])
+    if Conf.recaptcha_enable && !verify_recaptcha(:private_key => Conf.recaptcha_private)
       respond_to do |format|
         flash.now[:error] = 'Verification text was not entered correctly - your invitations have not been sent.'
         format.html { render :action ="" 'invite' }
@@ -208,7 +208,7 @@
           format.html { render :action ="" 'invite' }
         else      
           flash[:notice] = error_msg
-          format.html { redirect_to group_path(params[:id]) }
+          format.html { redirect_to network_path(params[:id]) }
         end
       end
     end
@@ -334,10 +334,10 @@
     respond_to do |format|
       format.html {
          
-        @lod_nir  = group_url(@network)
-        @lod_html = group_url(:id => @network.id, :format => 'html')
-        @lod_rdf  = group_url(:id => @network.id, :format => 'rdf')
-        @lod_xml  = group_url(:id => @network.id, :format => 'xml')
+        @lod_nir  = network_url(@network)
+        @lod_html = network_url(:id => @network.id, :format => 'html')
+        @lod_rdf  = network_url(:id => @network.id, :format => 'rdf')
+        @lod_xml  = network_url(:id => @network.id, :format => 'xml')
          
         # show.rhtml
       }
@@ -372,7 +372,7 @@
           @network.update_tags
         end
         flash[:notice] = 'Group was successfully created.'
-        format.html { redirect_to group_url(@network) }
+        format.html { redirect_to network_url(@network) }
       else
         format.html { render :action ="" "new" }
       end
@@ -385,7 +385,7 @@
       if @network.update_attributes(params[:network])
         @network.refresh_tags(convert_tags_to_gem_format(params[:network][:tag_list]), current_user) if params[:network][:tag_list]
         flash[:notice] = 'Group was successfully updated.'
-        format.html { redirect_to group_url(@network) }
+        format.html { redirect_to network_url(@network) }
       else
         format.html { render :action ="" "edit" }
       end
@@ -398,7 +398,7 @@
 
     respond_to do |format|
       flash[:notice] = 'Group was successfully deleted.'
-      format.html { redirect_to groups_url }
+      format.html { redirect_to networks_url }
     end
   end
  
@@ -466,7 +466,7 @@
     (err = Network.new.errors).add(:id, message)
     
     respond_to do |format|
-      format.html { redirect_to groups_url }
+      format.html { redirect_to networks_url }
     end
   end
 end

Modified: branches/datasets/app/controllers/search_controller.rb (2907 => 2908)


--- branches/datasets/app/controllers/search_controller.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/controllers/search_controller.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -35,7 +35,7 @@
       when 'workflows'
         redirect_to(workflows_path(:query => params[:query]))
       when 'files'
-        redirect_to(files_path(:query => params[:query]))
+        redirect_to(blobs_url(:query => params[:query]))
       when 'packs'
         redirect_to(packs_path(:query => params[:query]))
       when 'services'
@@ -121,7 +121,7 @@
 
       markup += "<item>";
       markup += "<title>" + f.title + "</title>";
-      markup += "<link>" + file_url(f) + "</link>";
+      markup += "<link>" + blob_url(f) + "</link>";
       markup += "<description>" + sanitize(f.body_html) + "</description>";
       markup += "<pubDate>" + time_string(f.created_at) + "</pubDate>";
       markup += "<media:content url="" + f.named_download_url + "\"";

Modified: branches/datasets/app/controllers/sessions_controller.rb (2907 => 2908)


--- branches/datasets/app/controllers/sessions_controller.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/controllers/sessions_controller.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -5,6 +5,7 @@
 
 require 'uri'
 require 'openid'
+require 'openid/extensions/sreg'
 require 'openid/store/filesystem'
 
 class SessionsController < ApplicationController
@@ -59,16 +60,43 @@
     
     # create user object if one does not exist
     unless @user = User.find(:first, :conditions => ["openid_url = ?", response.identity_url])
-      @user = User.new(:openid_url => response.identity_url, :name => response.identity_url, :activated_at => Time.now, :last_seen_at => Time.now)
-      redirect_to_edit_user = @user.save
+
+      # Get sreg attributes to seed new user with some pre-filled values
+      registration_info = OpenID::SReg::Response.from_success_response(response).data
+
+      name = registration_info["fullname"]
+      unless name
+        flash[:notice] ||= ""
+        flash[:notice] << "Please enter your name to be displayed to other users of the site.<br/>"
+        name = "OpenID User"
+      end
+
+      #email = registration_info["email"]
+      #email_to_use = nil
+      ## Only pre-fill the email if it doesn't already exist in the system, or this will silently fail
+      #if email
+      #  if !User.find_by_email(email) && !User.find_by_unconfirmed_email(email)
+      #    email_to_use = email
+      #  else
+      #    flash[:notice] ||= ""
+      #    flash[:notice] << "The email address associated with your OpenID is already in use. " +
+      #                      "Please enter a unique email address in the form below."
+      #  end
+      #end
+
+      @user = User.new(:openid_url => response.identity_url, :name => name, #:email => email_to_use
+                       :activated_at => Time.now, :last_seen_at => Time.now)
+
+      @user.save
+
+      # Always redirect, user may not want to use the sreg-provided attributes
+      redirect_to_edit_user = true
     end
 
     # storing both the openid_url and user id in the session for for quick
     # access to both bits of information.  Change as needed.
     self.current_user = @user
 
-    flash[:notice] = "Logged in as address@hidden"
-     
     if redirect_to_edit_user == true
       redirect_to url_for(:controller => 'users', :action ="" 'edit', :id => self.current_user)
     else
@@ -104,6 +132,11 @@
         if request.post?
           request = consumer.begin(openid_url)
 
+          sregreq = OpenID::SReg::Request.new
+          #sregreq.request_fields([''], true) # required fields
+          sregreq.request_fields(['fullname','email'], false) # optional fields
+
+          request.add_extension(sregreq)
           return_to = url_for(:action="" 'complete')
           trust_root = url_for(:controller=>'')
           

Modified: branches/datasets/app/controllers/users_controller.rb (2907 => 2908)


--- branches/datasets/app/controllers/users_controller.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/controllers/users_controller.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -145,17 +145,9 @@
     # check that captcha was entered correctly
 
     unless RAILS_ENV == 'test'
-      if true
-        if Conf.recaptcha_enable
-          if !verify_recaptcha(:private_key => Conf.recaptcha_private)
-            flash.now[:error] = 'Recaptcha text was not entered correctly - please try again.'
-            render :action ="" 'new'
-            return
-          end
-        end
-      else
-        if !captcha_valid?(params[:validation][:captcha_id], params[:validation][:captcha_validation])
-          flash.now[:error] = 'Verification text was not entered correctly - please try again.'
+      if Conf.recaptcha_enable
+        if !verify_recaptcha(:private_key => Conf.recaptcha_private)
+          flash.now[:error] = 'Recaptcha text was not entered correctly - please try again.'
           render :action ="" 'new'
           return
         end
@@ -411,7 +403,8 @@
   
   def process_invitations
     # first of all, check that captcha was entered correctly
-    if !captcha_valid?(params[:invitations][:captcha_id], params[:invitations][:captcha_validation])
+    captcha_verified = false
+    if Conf.recaptcha_enable && !verify_recaptcha(:private_key => Conf.recaptcha_private)
       respond_to do |format|
         flash.now[:error] = 'Verification text was not entered correctly - your invitations have not been sent.'
         format.html { render :action ="" 'invite' }

Modified: branches/datasets/app/controllers/workflows_controller.rb (2907 => 2908)


--- branches/datasets/app/controllers/workflows_controller.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/controllers/workflows_controller.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -988,7 +988,8 @@
 
         if ct.nil?
           ct = ContentType.create(:user_id => current_user.id,
-            :mime_type => file.content_type, :title => params[:workflow][:type_other])
+            :mime_type => file.content_type, :title => params[:workflow][:type_other],
+            :category => 'Workflow')
         end
 
         workflow_to_set.content_type = ct

Modified: branches/datasets/app/helpers/users_helper.rb (2907 => 2908)


--- branches/datasets/app/helpers/users_helper.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/helpers/users_helper.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -9,7 +9,7 @@
     url = ""
     
     case bookmarkableType
-      when 'Blob'; url = ""
+      when 'Blob'; url = ""
       when 'Workflow'; url = ""
       when 'Pack'; url = ""
       when 'Blog'; url = ""

Modified: branches/datasets/app/models/blob.rb (2907 => 2908)


--- branches/datasets/app/models/blob.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/models/blob.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -29,14 +29,10 @@
                :boost => "rank",
                :include => [ :comments ]) if Conf.solr_enable
 
-  belongs_to :content_blob
+  belongs_to :content_blob, :dependent => :destroy
   belongs_to :content_type
   belongs_to :license
  
-
-  # :dependent => :destroy is not supported in belongs_to in rails 1.2.6
-  after_destroy { |b| b.content_blob.destroy }
-
   validates_presence_of :content_blob
   validates_presence_of :content_type
 

Modified: branches/datasets/app/models/notifier.rb (2907 => 2908)


--- branches/datasets/app/models/notifier.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/models/notifier.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -27,7 +27,7 @@
   end
   
   def membership_request(requestor, network, membership, base_url)
-    recipients network.owner.email
+    recipients network.administrators(true).select{|admin| admin.send_notifications?}.map{|u| u.email}
     from Conf.notifications_email_address
     subject "#{Conf.sitename} - #{requestor.name} would like to join the #{network.title} Group"
     
@@ -40,7 +40,7 @@
   end
   
   def auto_join_group(member, network, base_url)
-    recipients network.owner.email
+    recipients network.administrators(true).select{|admin| admin.send_notifications?}.map{|u| u.email}
     from Conf.notifications_email_address
     subject "#{Conf.sitename} - #{member.name} has joined the #{network.title} Group"
     

Modified: branches/datasets/app/models/pack.rb (2907 => 2908)


--- branches/datasets/app/models/pack.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/models/pack.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -784,9 +784,4 @@
 
     boost
   end
-
-  # touch method that mimics the simple use of the rails 2 touch method
-  def touch
-    update_attribute(:updated_at, Time.now)
-  end
 end

Modified: branches/datasets/app/models/pack_contributable_entry.rb (2907 => 2908)


--- branches/datasets/app/models/pack_contributable_entry.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/models/pack_contributable_entry.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -75,7 +75,6 @@
   end
 
   def touch_pack
-    # Rails 2 - use pack.destroyed? instead of pack.contribution.nil?
-    pack.touch unless pack.contribution.nil?
+    pack.touch unless pack.destroyed?
   end
 end

Modified: branches/datasets/app/models/pack_remote_entry.rb (2907 => 2908)


--- branches/datasets/app/models/pack_remote_entry.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/models/pack_remote_entry.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -28,8 +28,7 @@
   end
 
   def touch_pack
-    # Rails 2 - use pack.destroyed? instead of pack.contribution.nil?
-    pack.touch unless pack.contribution.nil?
+    pack.touch unless pack.destroyed?
   end
 
   def available?

Modified: branches/datasets/app/models/preview.rb (2907 => 2908)


--- branches/datasets/app/models/preview.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/models/preview.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -9,9 +9,6 @@
 
   acts_as_structured_data
 
-  # :dependent => :destroy is not supported in belongs_to in rails 1.2.6
-  after_destroy { |p| p.content_blob.destroy }
-
   def file_name(type)
     "#{PREFIX}/#{id}/#{type}"
   end

Modified: branches/datasets/app/models/relationship.rb (2907 => 2908)


--- branches/datasets/app/models/relationship.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/models/relationship.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -18,7 +18,6 @@
   after_destroy :touch_context
 
   def touch_context
-    # Rails 2 - use context.destroyed? instead of context.contribution.nil?
-    context.touch if !context.contribution.nil? && context.respond_to?(:touch)
+    context.touch unless context.destroyed?
   end
 end

Modified: branches/datasets/app/models/workflow.rb (2907 => 2908)


--- branches/datasets/app/models/workflow.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/models/workflow.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -22,7 +22,7 @@
            :order => "created_at DESC",
            :dependent => :destroy
 
-  belongs_to :content_blob
+  belongs_to :content_blob, :dependent => :destroy
   belongs_to :content_type
   belongs_to :license
     
@@ -63,7 +63,7 @@
     
     format_attribute :body
 
-    belongs_to :content_blob
+    belongs_to :content_blob, :dependent => :destroy
     belongs_to :content_type
     belongs_to :contributor, :polymorphic => true
 
@@ -71,9 +71,6 @@
     validates_presence_of :content_type
 
     acts_as_site_entity :owner_text => 'Version Uploader'
-    
-    # :dependent => :destroy is not supported in belongs_to in rails 1.2.6
-    after_destroy { |wv| wv.content_blob.destroy if wv.content_blob }
 
     # Destroy data sets + ports linked to this version after destroy
     after_destroy :clean_up_data_sets

Modified: branches/datasets/app/views/blobs/_blob.rhtml (2907 => 2908)


--- branches/datasets/app/views/blobs/_blob.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/blobs/_blob.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -23,10 +23,10 @@
 	  </tr>
 	  <tr>
 	    <td colspan="2">
-	      <% if Authorization.is_authorized?('download', nil, blob, current_user) %><%= icon "download", download_file_path(blob) %> <% end %>
-	      <% if Authorization.is_authorized?('show', nil, blob, current_user) %><%= icon "show", file_path(blob), nil, nil, "View" %> <% end %>
-	      <% if logged_in? and Authorization.is_authorized?('edit', nil, blob, current_user) %><%= icon "edit", edit_file_path(blob) %> <% end %>
-	      <% if logged_in? and blob.owner?(current_user) %><%= icon "destroy", file_path(blob), nil, :confirm => 'Are you sure?', :method => :delete %><% end %>
+	      <% if Authorization.is_authorized?('download', nil, blob, current_user) %><%= icon "download", download_blob_path(blob) %> <% end %>
+	      <% if Authorization.is_authorized?('show', nil, blob, current_user) %><%= icon "show", blob_url(blob), nil, nil, "View" %> <% end %>
+	      <% if logged_in? and Authorization.is_authorized?('edit', nil, blob, current_user) %><%= icon "edit", edit_blob_path(blob) %> <% end %>
+	      <% if logged_in? and blob.owner?(current_user) %><%= icon "destroy", blob_path(blob), nil, :confirm => 'Are you sure?', :method => :delete %><% end %>
 	    </td>
 	  </tr>
 	</table>

Modified: branches/datasets/app/views/blobs/_breadcrumbs.rhtml (2907 => 2908)


--- branches/datasets/app/views/blobs/_breadcrumbs.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/blobs/_breadcrumbs.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -1,4 +1,4 @@
-<li><%= link_to 'Files', files_path -%></li>
+<li><%= link_to 'Files', blobs_path -%></li>
 
 <% if ["show", "new", "edit", "all", "search"].include? controller.action_name.to_s -%>
   <li><b>&#187;</b></li>
@@ -8,7 +8,7 @@
   <% when "new" %>
     <li>Upload File</li>
   <% when "edit" %>
-		<li><%= link_to "#{contributable_name(@blob.id, 'Blob')}", file_path(@blob) -%></li>
+		<li><%= link_to "#{contributable_name(@blob.id, 'Blob')}", blob_path(@blob) -%></li>
 		<li><b>&#187;</b></li>
     <li>Manage</li>
   <% when "all" %>

Modified: branches/datasets/app/views/blobs/_table.rhtml (2907 => 2908)


--- branches/datasets/app/views/blobs/_table.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/blobs/_table.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -22,7 +22,7 @@
 						<p class="title">
 							<%= icon "blob", nil, nil, nil, '' %>
 							<% title = contributable_name(blob.id, 'Blob') %>
-							<%=link_to(query ? highlight_all(title, query) : title, file_path(blob)) %>
+							<%=link_to(query ? highlight_all(title, query) : title, blob_path(blob)) %>
 						</p>
 						
 						<p style="font-size: 85%; margin-top: 0; padding-top: 0;">
@@ -79,14 +79,14 @@
 						<p style="font-size:85%;"><b>File type: </b><%= h blob.content_type.title %></p>
 						
 						<p style="font-size: 85%;">
-							<a href="" file_path(blob) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(blob.rating, :precision => 1) %> / 5 (<%= pluralize blob.ratings.count, 'rating' %>)</a> |
-							<a href="" file_path(blob) + '#comments' -%>"><b>Comments: </b><%= blob.comments.count %></a> |
+							<a href="" blob_path(blob) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(blob.rating, :precision => 1) %> / 5 (<%= pluralize blob.ratings.count, 'rating' %>)</a> |
+							<a href="" blob_path(blob) + '#comments' -%>"><b>Comments: </b><%= blob.comments.count %></a> |
 							<b>Viewed:</b> <%=pluralize blob.contribution.site_viewings_count, "time" %> |
 				      <b>Downloaded:</b> <%=pluralize blob.contribution.site_downloads_count, "time" %>
 						</p>
 						
 						<% unless (tags = blob.tags).empty? %>
-							<a href="" file_path(blob) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
+							<a href="" blob_path(blob) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
 							<div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
 						<% else %>
 							<p style="font-size: 85%;"><i>This File has no tags!</i></p>
@@ -95,9 +95,9 @@
 				<% end %>
 					
 					<td class="actions" style="width: 80px;">
-				    <%= icon "show", file_path(blob), nil, nil, "View" %>
-					  <% if Authorization.is_authorized?("download", nil, blob, current_user) %><%= icon "download", download_file_path(blob) %><% end %>
-				    <% if mine?(blob) %><%= icon "manage", edit_file_path(blob), nil, nil, "Manage" %><% end %>
+				    <%= icon "show", blob_path(blob), nil, nil, "View" %>
+					  <% if Authorization.is_authorized?("download", nil, blob, current_user) %><%= icon "download", download_blob_path(blob) %><% end %>
+				    <% if mine?(blob) %><%= icon "manage", edit_blob_path(blob), nil, nil, "Manage" %><% end %>
 				  </td>
 			</tr>
 		<% end %>

Modified: branches/datasets/app/views/blobs/edit.rhtml (2907 => 2908)


--- branches/datasets/app/views/blobs/edit.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/blobs/edit.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -7,7 +7,7 @@
 
 <%= error_messages_for :blob %>
 
-<% form_for(:blob, :url ="" file_path(@blob), :html => { :method => :put }) do |f| %>
+<% form_for(:blob, :url ="" blob_path(@blob), :html => { :method => :put }) do |f| %>
 
   <p style="text-align: center;">
   	<strong>Title: </strong>
@@ -38,7 +38,7 @@
   <p>
     <center>
     	<%= submit_tag "Update",:disable_with => "Updating..." %> 
-		or <%= link_to "Cancel", file_path(@blob) %>
+		or <%= link_to "Cancel", blob_path(@blob) %>
 	</center>
   </p>
 <% end %>

Modified: branches/datasets/app/views/blobs/show.rhtml (2907 => 2908)


--- branches/datasets/app/views/blobs/show.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/blobs/show.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -2,10 +2,10 @@
 
 <ul class="sectionIcons">
 	<% if mine?(@blob) -%>
-		<li><%= icon('manage', edit_file_path(@blob), nil, nil, 'Manage File Entry')%></li>
+		<li><%= icon('manage', edit_blob_path(@blob), nil, nil, 'Manage File Entry')%></li>
 	<% end -%>
 	<% if Authorization.is_authorized?('destroy', nil, @blob, current_user) %>
-		<li><%= icon('destroy', file_path(@blob), nil, { :confirm => 'This deletes the File and all metadata such as tags, comments and ratings. Are you sure?', :method => :delete }, 'Delete File Entry') %></li>
+		<li><%= icon('destroy', blob_path(@blob), nil, { :confirm => 'This deletes the File and all metadata such as tags, comments and ratings. Are you sure?', :method => :delete }, 'Delete File Entry') %></li>
 	<% end %>
 </ul>
 
@@ -50,14 +50,14 @@
 			    <span class="title"><%=h @blob.title %></span>
 			</p>
 			
-			<p>
-			    <b>File name:</b>
-			    <%=h @blob.local_name %>
+			<p>
+			    <b>File name:</b>
+			    <%=h @blob.local_name %>
 			</p>
-			
-			<p>
-			    <b>File type:</b>
-			    <%=h @blob.content_type.title %>
+			
+			<p>
+			    <b>File type:</b>
+			    <%=h @blob.content_type.title %>
 			</p>
 			
 			<br/>
@@ -104,14 +104,14 @@
 	
 	<%= render :partial => "contributions/license_box", :locals => { :contributable => @blob } %>
 	
-	<%= render :partial => "contributions/credits_attributions_box", :locals => { :contributable => @blob, :edit_path => edit_file_path(@blob) } %>
+	<%= render :partial => "contributions/credits_attributions_box", :locals => { :contributable => @blob, :edit_path => edit_blob_path(@blob) } %>
 	
   <%= render :partial => "contributions/curation_box", :locals => { :contributable => @blob } %>
 
 	<%= render :partial => "tags/tags_box", :locals => { :taggable => @blob, 
 																											 :owner_id => ((@blob.contributor_type == 'User') ? @blob.contributor_id : nil), 
-																											 :add_path => tag_file_path(@blob), 
-																											 :edit_path => edit_file_path(@blob),
+																											 :add_path => tag_blob_path(@blob),
+																											 :edit_path => edit_blob_path(@blob),
 																											 :allow_edit => Authorization.is_authorized?('edit', nil, @blob, current_user) } %>
 																											 
   <%= render :partial => "contributions/shared_with_groups_box", :locals => { :contributable => @blob } %>
@@ -123,8 +123,8 @@
 	<%= render :partial => "contributions/attributed_by", :locals => { :contributable => @blob } %>
 	
 	<%= render :partial => "contributions/favourited_box", :locals => { :contributable => @blob,
-																																			:add_to_favourites_path => favourite_file_url(@blob),
-																																			:remove_from_favourites_path => favourite_delete_file_url(@blob) } %>
+																																			:add_to_favourites_path => favourite_blob_url(@blob),
+																																			:remove_from_favourites_path => favourite_delete_blob_url(@blob) } %>
 	
 	<%= render :partial => "contributions/statistics_box", :locals => { :contributable => @blob } %>
 </div>	
@@ -149,7 +149,7 @@
 	  
       <% if Authorization.is_authorized?('edit', nil, @blob, current_user) %>
         <ul class="sectionIcons">
-          <li><%= icon('edit', edit_file_path(@blob), nil, nil, 'Edit')%></li>
+          <li><%= icon('edit', edit_blob_path(@blob), nil, nil, 'Edit')%></li>
         </ul>
       <% end %>
     </div>

Modified: branches/datasets/app/views/contributions/_contributor_form.rhtml (2907 => 2908)


--- branches/datasets/app/views/contributions/_contributor_form.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/contributions/_contributor_form.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -17,7 +17,7 @@
       <p>
         <b>Administrator of...</b><br/>
         <% for n in user.networks_owned %>
-          <%= f.radio_button(:class_id, "Network-#{n.id}", { :checked => (current.class.to_s == "Network" and current.id.to_i == n.id) }) %> - <%= link_to h(n.title), group_path(n) %><br/>
+          <%= f.radio_button(:class_id, "Network-#{n.id}", { :checked => (current.class.to_s == "Network" and current.id.to_i == n.id) }) %> - <%= link_to h(n.title), network_path(n) %><br/>
         <% end %>
       </p>
     <% end %>
@@ -25,7 +25,7 @@
       <p>
         <b>Member of..</b><br/>
         <% for n in user.networks %>
-          <%= f.radio_button(:class_id, "Network-#{n.id}", { :checked => (current.class.to_s == "Network" and current.id.to_i == n.id) }) %> - <%= link_to h(n.title), group_path(n) %><br/>
+          <%= f.radio_button(:class_id, "Network-#{n.id}", { :checked => (current.class.to_s == "Network" and current.id.to_i == n.id) }) %> - <%= link_to h(n.title), network_path(n) %><br/>
         <% end %>
       </p>
     <% end %>

Modified: branches/datasets/app/views/contributions/_sharing_form.rhtml (2907 => 2908)


--- branches/datasets/app/views/contributions/_sharing_form.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/contributions/_sharing_form.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -140,48 +140,49 @@
 		<% end %>
 		
 		<br/>
-	
-		<!-- Explicit Group Permissions -->
-		<p><strong>Share with my Groups:</strong></p>
 
-    <div id="group_sharing_box" class="box_editing" style="padding-left: 1em; font-size: 93%;">
-      <% applicable_networks = (current_user.networks + current_user.networks_owned) %>
-      <% applicable_networks.each do |n| %>
-        <p>
-          <% perm = find_permission_for_contributor(perms, "Network", n.id) if edit -%>
-          <label for="" n.id %>">
-            <input class="group_sharing" <%= 'checked' if perm %> style="margin-right: 0.3em;"
-                   value="<%= n.id %>" type="checkbox" name="group_sharing[<%= n.id %>][id]" id="cb_group_sharing_<%= n.id %>"
-                    this.checked);"/>
-            <%= h(n.title) %>
-          </label>
-          <select name="group_sharing[<%= n.id %>][level]" style="font-size: 85%; margin: 0 0.5em;">
-            <option value="0" <%= 'selected="selected"' if perm and perm.level == 0 %>>View only</option>
-            <option value="1" <%= 'selected="selected"' if !edit or !perm or (perm and perm.level == 1) %>>View and Download only</option>
-            <option value="2" <%= 'selected="selected"' if perm and perm.level == 2 %>>View, Download and Update</option>
-          </select>
-        </p>
-      <% end %>
-      <br/>
-      <% if %w(Workflow Pack File).include?(c_type) %>
-        <div id="layout_options_box">
-          <strong>Layout:</strong>
-          <div class="box_infotext" style="margin: 1em 0">
-            <p>
-              One or more of the groups you have elected to share this <%= c_type -%> with have custom layouts specified.
-              To apply a group's custom layout to this <%= c_type -%>'s page, choose one from the list below or select
-              "Default" to keep the <%= Conf.sitename -%> default layout. This setting can be changed at any time by
-              visiting the 'edit' page.
-            </p>
+    <% unless (applicable_networks = (current_user.networks + current_user.networks_owned)).empty? %>
+      <!-- Explicit Group Permissions -->
+      <p><strong>Share with my Groups:</strong></p>
+
+      <div id="group_sharing_box" class="box_editing" style="padding-left: 1em; font-size: 93%;">
+        <% applicable_networks.each do |n| %>
+          <p>
+            <% perm = find_permission_for_contributor(perms, "Network", n.id) if edit -%>
+            <label for="" n.id %>">
+              <input class="group_sharing" <%= 'checked' if perm %> style="margin-right: 0.3em;"
+                     value="<%= n.id %>" type="checkbox" name="group_sharing[<%= n.id %>][id]" id="cb_group_sharing_<%= n.id %>"
+                      this.checked);"/>
+              <%= h(n.title) %>
+            </label>
+            <select name="group_sharing[<%= n.id %>][level]" style="font-size: 85%; margin: 0 0.5em;">
+              <option value="0" <%= 'selected="selected"' if perm and perm.level == 0 %>>View only</option>
+              <option value="1" <%= 'selected="selected"' if !edit or !perm or (perm and perm.level == 1) %>>View and Download only</option>
+              <option value="2" <%= 'selected="selected"' if perm and perm.level == 2 %>>View, Download and Update</option>
+            </select>
+          </p>
+        <% end %>
+        <br/>
+        <% if %w(Workflow Pack File).include?(c_type) %>
+          <div id="layout_options_box">
+            <strong>Layout:</strong>
+            <div class="box_infotext" style="margin: 1em 0">
+              <p>
+                One or more of the groups you have elected to share this <%= c_type -%> with have custom layouts specified.
+                To apply a group's custom layout to this <%= c_type -%>'s page, choose one from the list below or select
+                "Default" to keep the <%= Conf.sitename -%> default layout. This setting can be changed at any time by
+                visiting the 'edit' page.
+              </p>
+            </div>
+            <% selected_option = (Conf.layouts[contributable.contribution.layout]["network_id"] unless
+                contributable.contribution.nil? || contributable.contribution.layout.nil?) %>
+            <%= select_tag "layout", "<option value="">Default</option>" +
+                options_from_collection_for_select(applicable_networks.select {|n| n.layout_name}, 'id','title', selected_option) %>
+            <%# TODO: In Rails 2, have a link that allows a user to preview the selected layout using polymorphic_path %>
           </div>
-          <% selected_option = (Conf.layouts[contributable.contribution.layout]["network_id"] unless
-              contributable.contribution.nil? || contributable.contribution.layout.nil?) %>
-          <%= select_tag "layout", "<option value="">Default</option>" +
-              options_from_collection_for_select(applicable_networks.select {|n| n.layout_name}, 'id','title', selected_option) %>
-          <%# TODO: In Rails 2, have a link that allows a user to preview the selected layout using polymorphic_path %>
-        </div>
-      <% end %>
-    </div>
+        <% end %>
+      </div>
+    <% end %>
   </div>
 </div>
 

Modified: branches/datasets/app/views/contributions/_statistics.rhtml (2907 => 2908)


--- branches/datasets/app/views/contributions/_statistics.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/contributions/_statistics.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -9,5 +9,5 @@
 <% end -%>
 
 <p style="margin-top: 0.2em;">
-	<small>[ <%= link_to "see breakdown", eval("statistics_#{controller_visible_name(type.to_s.pluralize).singularize.downcase}_path(#{contributable.id})") -%> ]</small>
+	<small>[ <%= link_to "see breakdown", polymorphic_url(contributable, :action ="" :statistics) -%> ]</small>
 </p>
\ No newline at end of file

Modified: branches/datasets/app/views/feedback/index.rhtml (2907 => 2908)


--- branches/datasets/app/views/feedback/index.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/feedback/index.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -48,15 +48,10 @@
 			<p><b>Message</b></p>
 			<textarea id="feedback_content" name="content" rows="8" style="width: 400px;"><%= params[:content] %></textarea><br/>
 		<% if !logged_in? %>
-		<% c = prepare_captcha :type => :image -%>	
-		     <br/>
-	         <p style="text-align: center;">
-	            <%= captcha_hidden_field c, 'feedback' %>
-                <%= captcha_image_tag c %><br/>
-             </p>
-             <p style="text-align: center;"><%= captcha_label 'feedback', 'Type in the text from the image above' %></p>
-             <p style="text-align: center;"><%= captcha_text_field 'feedback' %></p>
-         <% end %>
+			<% if Conf.recaptcha_enable -%>
+				<%= recaptcha_tags(:public_key => Conf.recaptcha_public) -%>
+			<% end %>
+		<% end %>
 		  <br/><br>
 		
     	<center><%= submit_tag "Submit Feedback", :disable_with => "Submitting&hellip;" %></center>

Modified: branches/datasets/app/views/gadgets/_asset_manager.rhtml (2907 => 2908)


--- branches/datasets/app/views/gadgets/_asset_manager.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/gadgets/_asset_manager.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -41,10 +41,10 @@
         <div class="content">
           <ul class="gadget_list">
             <% current_user.networks_owned.each do |network_owned| %>
-              <li><%= icon "network-owned", nil, nil, nil, "" %> <%= link_to truncate(h(network_owned.title), :length => gadget_characters_limit), group_path(network_owned), :title => tooltip_title_attrib(h(network_owned.title)) %></li>
+              <li><%= icon "network-owned", nil, nil, nil, "" %> <%= link_to truncate(h(network_owned.title), :length => gadget_characters_limit), network_path(network_owned), :title => tooltip_title_attrib(h(network_owned.title)) %></li>
             <% end %>
             <% current_user.networks.each do |network_member| %>
-              <li><%= icon "network-member", nil, nil, nil, "" %> <%= link_to truncate(h(network_member.title), :length => gadget_characters_limit), group_path(network_member), :title => tooltip_title_attrib(h(network_member.title)) %></li>
+              <li><%= icon "network-member", nil, nil, nil, "" %> <%= link_to truncate(h(network_member.title), :length => gadget_characters_limit), network_path(network_member), :title => tooltip_title_attrib(h(network_member.title)) %></li>
             <% end %>
           </ul>
         </div>

Modified: branches/datasets/app/views/group_announcements/_breadcrumbs.rhtml (2907 => 2908)


--- branches/datasets/app/views/group_announcements/_breadcrumbs.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/group_announcements/_breadcrumbs.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -1,6 +1,6 @@
-<li><%= link_to 'Groups', groups_path -%></li>
+<li><%= link_to 'Groups', networks_path -%></li>
 <li><b>&#187;</b></li>
-<li><b><%= link_to h(@group.title), group_path(@group) -%></b></li>
+<li><b><%= link_to h(@group.title), network_path(@group) -%></b></li>
 <li><b>&#187;</b></li>
 <li><b><%= link_to "Group Announcements", group_announcements_path(@group) -%></b>
 

Modified: branches/datasets/app/views/home/_latest_comments.rhtml (2907 => 2908)


--- branches/datasets/app/views/home/_latest_comments.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/home/_latest_comments.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -20,7 +20,7 @@
 							</span>
 							<div class="box_standout" style="font-size: 85%; margin: 0.4em 2em; padding: 0.2em 0.5em;">
 								<%= truncate(strip_html(white_list(c.comment)), :length => 150) %>
-								<p style="text-align: right;">[ <%= link_to "More", (c.commentable_type == 'Network' ? group_url(c.commentable) + "#comment_#{c.id}" : contributable_url(c.commentable_id, c.commentable_type) + "#comment_#{c.id}") %> ]</p>
+								<p style="text-align: right;">[ <%= link_to "More", (c.commentable_type == 'Network' ? network_url(c.commentable) + "#comment_#{c.id}" : contributable_url(c.commentable_id, c.commentable_type) + "#comment_#{c.id}") %> ]</p>
 							</div>
 							<br/>
 						</li>

Modified: branches/datasets/app/views/home/_latest_groups.rhtml (2907 => 2908)


--- branches/datasets/app/views/home/_latest_groups.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/home/_latest_groups.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -12,7 +12,7 @@
 						<% if Authorization.is_authorized?("show", nil, g, current_user) %>
 							<li>
 								<%= icon('network', nil, nil, 'group icon', '') %>
-								<b><%= link_to h(g.title), group_path(g) %></b> 
+								<b><%= link_to h(g.title), network_path(g) %></b>
 								by <b><%= contributor(g.user_id, 'User') %></b>
 								(<%= timeago_fuzzy g.created_at %>)
 							</li>

Modified: branches/datasets/app/views/mailer/group_invite_new_user.rhtml (2907 => 2908)


--- branches/datasets/app/views/mailer/group_invite_new_user.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/mailer/group_invite_new_user.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -14,7 +14,7 @@
 <% end -%>
 
 You can find out more:
---> about this group : <%= Conf.base_uri + group_path(@group_id) %> 
+--> about this group : <%= Conf.base_uri + network_path(@group_id) %>
 --> and about me (<%= @name -%>) from my profile page : <%= url_for : false, :controller => 'users', :host => Conf.hostname, :id => @user_id, :action ="" 'show' %>
 
 

Modified: branches/datasets/app/views/networks/_banner.rhtml (2907 => 2908)


--- branches/datasets/app/views/networks/_banner.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/networks/_banner.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -1,10 +1,10 @@
 <% owner ||= true %>
 <div class="network_banner">
   <p>
-    <strong><%= link_to h(network.title), group_path(network.id) %></strong> 
+    <strong><%= link_to h(network.title), network_path(network.id) %></strong>
     <% if logged_in? and network.owner? current_user.id %>
-      <%= icon "edit", edit_group_path(network) %> 
-      <%= icon "destroy", group_path(network), nil, :confirm => "Are you sure?", :method => "destroy" %>
+      <%= icon "edit", edit_network_path(network) %>
+      <%= icon "destroy", network_path(network), nil, :confirm => "Are you sure?", :method => "destroy" %>
     <% end %>
   </p>
   

Modified: branches/datasets/app/views/networks/_breadcrumbs.rhtml (2907 => 2908)


--- branches/datasets/app/views/networks/_breadcrumbs.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/networks/_breadcrumbs.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -1,4 +1,4 @@
-<li><%= link_to 'Groups', groups_path -%></li>
+<li><%= link_to 'Groups', networks_path -%></li>
 
 <% if ["show", "new", "edit", "search", "all", "invite"].include? controller.action_name.to_s -%>
   <li><b>&#187;</b></li>
@@ -8,7 +8,7 @@
   <% when "new" %>
     <li>New Group</li>
   <% when "edit" %>
-		<li><%= link_to "#{h(@network.title)}", group_path(@network) %></li>
+		<li><%= link_to "#{h(@network.title)}", network_path(@network) %></li>
 		<li><b>&#187;</b></li>
     <li>Manage</li>
   <% when "search" %>  
@@ -16,7 +16,7 @@
   <% when "all" %>
     <li>All Groups</li>
 	<% when "invite" %>
-	  <li><%= link_to "#{h(@network.title)}", group_path(@network) %></li>
+	  <li><%= link_to "#{h(@network.title)}", network_path(@network) %></li>
 		<li><b>&#187;</b></li>
 		<li>Invite people to group</li>
   <% else %>

Modified: branches/datasets/app/views/networks/_form.rhtml (2907 => 2908)


--- branches/datasets/app/views/networks/_form.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/networks/_form.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -1,7 +1,7 @@
   <%= _javascript__include_tag "fckeditor/fckeditor.js" %>
 	
 	<p>
-    <b>Administrator</b><br />
+    <b>Owner</b><br />
     <%= render :partial => "users/avatar", :locals => { :user => @network.owner } %>
     <%= form.hidden_field :user_id %>
   </p>

Modified: branches/datasets/app/views/networks/_invite.rhtml (2907 => 2908)


--- branches/datasets/app/views/networks/_invite.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/networks/_invite.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -9,7 +9,7 @@
           var xmlhttp_<%= n.id %> = new XMLHttpRequest();
 					var xmlhttp_<%= n.id %>_params = "&user_id=<%= user.id %>&membership[message]=";
 					
-          xmlhttp_<%= n.id %>.open('POST', '<%= membership_invite_group_path(n) %>', true);
+          xmlhttp_<%= n.id %>.open('POST', '<%= membership_invite_network_path(n) %>', true);
           
 					// Send the proper header information along with the request
 					xmlhttp_<%= n.id %>.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

Modified: branches/datasets/app/views/networks/_table.rhtml (2907 => 2908)


--- branches/datasets/app/views/networks/_table.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/networks/_table.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -5,7 +5,7 @@
 		<% for network in collection -%>
 			<tr class="<%= (odd_row = !odd_row) ? "odd_row" : "even_row" %>">
 					<td style="width: 120px;">
-						<p style="margin-top:0; padding-top:0; text-align: center;"><b>Administrator:</b></p>
+						<p style="margin-top:0; padding-top:0; text-align: center;"><b>Owner:</b></p>
 						<center><%= contributor(network.user_id, "User", true, 80) %></center>
 					</td>
 					<td style="text-align: left;">
@@ -15,7 +15,7 @@
 							<% else %>
 								<%= icon "network-member", nil, nil, nil, '' %>
 							<% end %>
-							<%=link_to(query ? highlight_all(h(network.title), query) : h(network.title), group_path(network)) %>
+							<%=link_to(query ? highlight_all(h(network.title), query) : h(network.title), network_path(network)) %>
 						</p>
 				<% cache(:controller => 'groups_cache', :action ="" 'listing', :id => network.id) do -%>
 						<p style="font-size: 85%;">
@@ -51,7 +51,7 @@
 						<% end -%>
 						
 						<% unless (tags = network.tags).empty? -%>
-							<a href="" group_path(network) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
+							<a href="" network_path(network) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
 							<div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
 					  <% else -%>
 							<p style="font-size: 85%;"><i>This Group has not been tagged yet!</i></p>
@@ -66,15 +66,15 @@
 						<% end -%>
 					</td>
 					<td class="actions">
-						<%= icon "show", group_path(network), nil, nil, "View" %> 
+						<%= icon "show", network_path(network), nil, nil, "View" %>
 						<% if mine? network -%>
-							<%= icon "manage", edit_group_path(network) %>
+							<%= icon "manage", edit_network_path(network) %>
 						<% elsif logged_in? %> <!-- admins can't leave the group or request membership! -->
 						  <% if network.member?(current_user.id) %>
 							  <!-- user is not an admin, but a member already -->
 								<% cur_membership = Membership.find(:first, :conditions => ["network_id = ? AND user_id = ?", network.id, current_user.id] ) %>
 			          <% if cur_membership %>
-			            <%= icon('network-leave', user_membership_path(cur_membership.user_id, cur_membership) + "?return_to=" + groups_path, nil, { :confirm => "Are you sure want to leave this group?", :method => :delete }, 'Leave Group') %>
+			            <%= icon('network-leave', user_membership_path(cur_membership.user_id, cur_membership) + "?return_to=" + networks_path, nil, { :confirm => "Are you sure want to leave this group?", :method => :delete }, 'Leave Group') %>
 			          <% end %>
 							<% elsif !current_user.membership_pending?(network.id) && !network.invitation_only? %>
 							  <!-- not an admin, not a member yet and hasn't got pending request -->

Modified: branches/datasets/app/views/networks/edit.rhtml (2907 => 2908)


--- branches/datasets/app/views/networks/edit.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/networks/edit.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -6,7 +6,7 @@
 
 <%= error_messages_for :network %>
 
-<% form_for(:network, :url ="" group_path(@network), :html => { :method => :put }) do |f| %>
+<% form_for(:network, :url ="" network_path(@network), :html => { :method => :put }) do |f| %>
   <%= render :partial => "networks/form", :object => f %>
 	
 	<br/>

Modified: branches/datasets/app/views/networks/index.rhtml (2907 => 2908)


--- branches/datasets/app/views/networks/index.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/networks/index.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -1,6 +1,6 @@
 <ul class="sectionIcons">
-	<li><%= icon "network-member", new_group_path, nil, nil, "Create New Group" %></li>
-	<li><%= icon "view-all", all_groups_path, nil, nil, "View All Groups" %></li>
+	<li><%= icon "network-member", new_network_path, nil, nil, "Create New Group" %></li>
+	<li><%= icon "view-all", all_networks_path, nil, nil, "View All Groups" %></li>
 </ul>
 
 <% cache(:controller => 'groups', :action ="" 'all_tags') do -%>

Modified: branches/datasets/app/views/networks/invite.rhtml (2907 => 2908)


--- branches/datasets/app/views/networks/invite.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/networks/invite.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -1,4 +1,4 @@
-<h1>Invite people to group: <%= link_to @network.title, group_path(@network) -%></h1>
+<h1>Invite people to group: <%= link_to @network.title, network_path(@network) -%></h1>
 
 <p>
   Here you can invite users to this group. The options are:<br/>
@@ -28,7 +28,7 @@
       Select a name from the list, type in a message to the user and click "Invite".
     </p>
 
-    <% form_tag(membership_invite_group_path(@network), :method => :post) do %>
+    <% form_tag(membership_invite_network_path(@network), :method => :post) do %>
       <table cellpadding="0" cellspacing="0">
         <tr>
           <td>&nbsp;</td>
@@ -55,7 +55,7 @@
       Type in email addresses you want to send invitations to, personal message to new users and click "Invite".
     </p>
 
-    <% form_tag (membership_invite_external_group_path(@network), :method => :post) do %>
+    <% form_tag (membership_invite_external_network_path(@network), :method => :post) do %>
       <%= hidden_field_tag "radio_choice", "" -%>
       <table>
         <tr>
@@ -71,19 +71,12 @@
             <% msg_text_val = ((params[:invitations].nil? || params[:invitations][:msg_text].nil?) ? "" : params[:invitations][:msg_text]) %>
             <%= text_area_tag "invitations[msg_text]", msg_text_val, :rows => 4, :style => "width: 500px" -%><br/>
 
-            <table style="margin-top: 1.5em;">
-              <tr>
-                <td>
-                  <% c = prepare_captcha :type => :image -%>
-                  <%= captcha_image_tag c -%>
-                </td>
-                <td style="vertical-align: middle;">
-                  <%= captcha_hidden_field c, 'invitations' -%>
-                  <%= captcha_label 'invitations', 'Type in the text from the image on the left:' -%><br/>
-                  <%= captcha_text_field 'invitations', :size => 40 -%>
-                </td>
-              </tr>
-            </table>
+            <% if Conf.recaptcha_enable -%>
+              <center>
+                <%= recaptcha_tags(:public_key => Conf.recaptcha_public) -%>
+              </center>
+            <% end -%>
+
           </td>
         </tr>
         <tr>

Modified: branches/datasets/app/views/networks/new.rhtml (2907 => 2908)


--- branches/datasets/app/views/networks/new.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/networks/new.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -6,7 +6,7 @@
 
 <%= error_messages_for :network %>
 
-<% form_for(:network, :url ="" groups_path) do |f| %>
+<% form_for(:network, :url ="" networks_path) do |f| %>
   <%= render :partial => "networks/form", :object => f %>
 	
 	<br/>

Modified: branches/datasets/app/views/networks/show.rhtml (2907 => 2908)


--- branches/datasets/app/views/networks/show.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/networks/show.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -25,11 +25,11 @@
 
     <% if @network.administrator?(current_user.id) %>
       <li><%= icon('announcement', new_group_announcement_path(@network), 'Make a new Group Announcement', nil, 'Make a Group Announcement') -%></li>
-			<li><%= icon('network-invite', invite_group_path(@network), 'Invite People', nil, 'Invite People') -%></li>
+			<li><%= icon('network-invite', invite_network_path(@network), 'Invite People', nil, 'Invite People') -%></li>
     <% end %>
     <% if mine? @network %>
-			<li><%= icon('edit', edit_group_path(@network), 'Edit', nil, 'Edit Group') %></li>
-      <li><%= icon('destroy', group_path(@network), 'Delete Group', { :confirm => 'Are you sure?', :method => :delete }, 'Delete Group') %></li>
+			<li><%= icon('edit', edit_network_path(@network), 'Edit', nil, 'Edit Group') %></li>
+      <li><%= icon('destroy', network_path(@network), 'Delete Group', { :confirm => 'Are you sure?', :method => :delete }, 'Delete Group') %></li>
     <% end %>
   </ul>
 <% end %>
@@ -142,8 +142,8 @@
 	
 	<%= render :partial => "tags/tags_box", :locals => { :taggable => @network,
 																											 :owner_id => (@network.user_id),  
-																											 :add_path => tag_group_path(@network), 
-																											 :edit_path => edit_group_path(@network),
+																											 :add_path => tag_network_path(@network),
+																											 :edit_path => edit_network_path(@network),
 																											 :allow_edit => logged_in? ? @network.user_id == current_user.id : false } %>
 	
 	<%= render :partial => "announcements", :locals => { :group => @network, :count => 5 } -%>

Modified: branches/datasets/app/views/users/_invite.rhtml (2907 => 2908)


--- branches/datasets/app/views/users/_invite.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/users/_invite.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -26,14 +26,10 @@
 		<table style="margin-top: 2em;">
 			<tr>
 				<td>
-		      <% c = prepare_captcha :type => :image -%>
-					<%= captcha_image_tag c -%>
+		<% if Conf.recaptcha_enable -%>
+			<%= recaptcha_tags(:public_key => Conf.recaptcha_public) -%>
+		<% end %>
 				</td>
-				<td style="vertical-align: top;">
-				  <%= captcha_hidden_field c, 'invitations' -%>
-					<%= captcha_label 'invitations', 'Type in the text from the image on the left:' -%><br/>
-	        <%= captcha_text_field 'invitations', :size => 40 -%>
-				</td>
 			</tr>
 		</table>
 		

Modified: branches/datasets/app/views/users/new.rhtml (2907 => 2908)


--- branches/datasets/app/views/users/new.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/users/new.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -26,30 +26,17 @@
 
 <% form_for(:user, :url ="" users_path) do |f| %>
 
-  <center>
-    <h2>Anti-spam verification</h2>
-  <% if true -%>
-    <%= recaptcha_tags(:public_key => Conf.recaptcha_public) if Conf.recaptcha_enable -%> 
-  <% else -%>
-    <table style="margin-top: 2em;">
-      <tr>
-        <td>
-          <% c = prepare_captcha :type => :image -%>
-          <%= captcha_image_tag c -%>
-        </td>
-        <td style="vertical-align: top;">
-          <%= captcha_hidden_field c, 'validation' -%>
-          <%= captcha_label 'validation', 'Type in the text from the image on the left:' -%><br/>
-          <%= captcha_text_field 'validation', :size => 40 -%>
-        </td>
-      </tr>
-    </table>
+  <% if Conf.recaptcha_enable -%>
+    <center>
+      <h2>Anti-spam verification</h2>
+      <%= recaptcha_tags(:public_key => Conf.recaptcha_public) -%> 
+    </center>
+
+    <br />
+    <br />
+
   <% end -%>
-  </center>
       
-  <br />
-  <br />
-
   	<div class="fold">
   		<div class="foldTitle">
       	Register with a Username and Password

Modified: branches/datasets/app/views/workflows/_main_metadata_form.rhtml (2907 => 2908)


--- branches/datasets/app/views/workflows/_main_metadata_form.rhtml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/app/views/workflows/_main_metadata_form.rhtml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -50,7 +50,7 @@
 					</p>
 					<%= select_tag "workflow[type]", 
 												 options_for_select(['Select...'] + workflow_types, (params[:workflow].nil? ? nil : params[:workflow][:type])),
-												 : "if (this.value == 'Other') { $('workflow[type_other]').show(); $('workflow[type_other]').focus(); } else { $('workflow[type_other]').hide(); }",
+												 : "if (this.value == 'Other') { $('workflow_type_other').show(); $('workflow_type_other').focus(); } else { $('workflow_type_other').hide(); }",
 												 :style => "vertical-align: middle;" -%>
 					<%= text_field_tag "workflow[type_other]",
 														 (params[:workflow].nil? ? '' : params[:workflow][:type_other]),

Modified: branches/datasets/config/base_schema.xml (2907 => 2908)


--- branches/datasets/config/base_schema.xml	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/config/base_schema.xml	2012-01-19 10:38:36 UTC (rev 2908)
@@ -95,8 +95,8 @@
     <column type="integer"  name="svg_blob_id"/>
     <column type="datetime" name="created_at"/>
 
-    <belongs-to target="image_blob" class_name="ContentBlob" foreign_key="image_blob_id"/>
-    <belongs-to target="svg_blob"   class_name="ContentBlob" foreign_key="svg_blob_id"/>
+    <belongs-to target="image_blob" class_name="ContentBlob" dependent="destroy" foreign_key="image_blob_id"/>
+    <belongs-to target="svg_blob"   class_name="ContentBlob" dependent="destroy" foreign_key="svg_blob_id"/>
 
   </table>
 

Modified: branches/datasets/config/environment.rb (2907 => 2908)


--- branches/datasets/config/environment.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/config/environment.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -45,6 +45,7 @@
     :headliner,
     :mannie_taverna_scufl,
     :mannie_taverna_t2flow,
+    :oauth,
     :oauth_plugin,
     :open_id_authentication,
     :paginating_find,
@@ -53,7 +54,6 @@
     :recaptcha,
     :simile_timeline,
     :structured_data,
-    :validates_captcha,
     :validates_email_veracity_of
   ]
 

Modified: branches/datasets/config/routes.rb (2907 => 2908)


--- branches/datasets/config/routes.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/config/routes.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -82,7 +82,7 @@
   map.resource :session
   
   # openid authentication
-  map.resource :openid
+  map.resource :openid, :controller => 'openid'
   
   # packs
   map.resources :packs, 
@@ -158,20 +158,20 @@
   end
 
   # files (downloadable)
-  map.resources :files, 
-    :controller => :blobs,
+  map.resources :blobs,
+    :as => :files,
     :collection => { :search => :get }, 
     :member => { :download => :get,
                  :statistics => :get,
                  :favourite => :post,
                  :favourite_delete => :delete,
                  :rate => :post, 
-                 :tag => :post } do |file|
+                 :tag => :post } do |blob|
     # Due to restrictions in the version of Rails used (v1.2.3), 
     # we cannot have reviews as nested resources in more than one top level resource.
     # ie: we cannot have polymorphic nested resources.
-    #file.resources :reviews
-    file.resources :comments, :collection => { :timeline => :get }
+    #blob.resources :reviews
+    blob.resources :comments, :collection => { :timeline => :get }
   end
 
   # blogs
@@ -239,17 +239,17 @@
     user.resources :reports, :controller => :user_reports
   end
 
-  map.resources :groups,
-    :controller => :networks, 
+  map.resources :networks,
+    :as => :groups,
     :collection => { :all => :get, :search => :get }, 
     :member => { :invite => :get,
                  :membership_invite => :post,
                  :membership_invite_external => :post,
                  :membership_request => :get, 
                  :rate => :post, 
-                 :tag => :post } do |group|
-    group.resources :announcements, :controller => :group_announcements
-    group.resources :comments, :collection => { :timeline => :get }
+                 :tag => :post } do |network|
+    network.resources :group_announcements, :as => :announcements, :name_prefix => nil
+    network.resources :comments, :collection => { :timeline => :get }
   end
   
   # The priority is based upon order of creation: first created -> highest priority.

Modified: branches/datasets/installers/fedora/README.txt (2907 => 2908)


--- branches/datasets/installers/fedora/README.txt	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/installers/fedora/README.txt	2012-01-19 10:38:36 UTC (rev 2908)
@@ -1,21 +1,19 @@
-myExperiment Fedora Installer Instructions
-==========================================
+myExperiment Fedora/RedHat/CentOS Installer Instructions
+========================================================
 
-04/11/2011 THIS INSTALLER IS STILL UNDER TESTING AND WILL BE ADDED SHORTLY.
+The files in this directory are an installer for myExperiment on Fedora 13 and
+consequently RedHat 6 and CentOS 6.0.  The installer is designed to work on a 
+freshly installed version of the operating systems, you may have problems if 
+you are installing on an existing system.
 
-The files in this directory are an installer for myExperiment on Fedora 13
-that has had all the latest updates installed (based on updates available on
-23/10/2011).  The installer is designed to work on a freshly installed version
-of Ubuntu, you may have problems if you are installing on an existing system.
-
-install.bash is the main install script and can be downloaded and run from
+install.bash is the main install script and can be downloaded and run from 
 the current working directory as follows:
 
   /bin/bash install.bash
 
-This install script requires the settings file, settings.bash, which needs to
-be kept in th same directory.  This can be created by copying the 
-default_settings.bash to settings.bash and making the followiing changes 
+This install script requires the settings file, settings.bash, which needs to be 
+kept in the same directory.  This can be created by copying the
+default_settings.bash to settings.bash and making the following changes
 before running install.bash:
 
 myexp_root_password - Choose a password for the root account of MySQL.  If for
@@ -25,28 +23,34 @@
 myexp_user_password - Choose a password for the account that myExperiment uses
 to access databases it creates for storing myExperiment data.
 
-fq_server_name - The fully-qualified server name for a machine, e.g
-myexperiment.example.org
+fq_server_name - The fully-qualified server name and domain for your server,
+i.e. the A record. E.g. myexperiment.example.org
 
-exim_smarthost - The mail server you want to user as a relay for emails
-e.g. smtp.example.org
+exim_smarthost_server - The mail server you want to user as a relay for emails.
+E.g. smtp
 
+exim_smarthost_domain - The mail server you want to user as a relay for emails.
+E.g. example.org
 
+myexp_cname - The location you intend to host the myExperiment site.  This may
+be the same as fq_server_name.
+E.g. myexperiment.example.org
+
+
 == Post-installation configuration ==
 
-The installer is designed to work on a freshly installed version of Ubuntu and
-will do minimal configuration of myExperiment.  To do further configuration
-you will need to edit settings.yml in the config directory of the SVN checkout
-of myExperiment by default this /var/rails/myexperiment/config/.
+The installer is designed to work on a freshly installed version of Fedora 13 / 
+RedHat 6 / CentOS 6.0 and will do minimal configuration of myExperiment.  To do 
+further configuration you will need to edit settings.yml in the config directory 
+of the SVN checkout of myExperiment by default this /var/rails/myexperiment/config/.  
 
-After updating the settings file you will need to restart the myExperiment
-server.  To do this go to the file
-/var/rails/myexperiment/tmp/pids/mongrel.pid
-and copy the process id number in this file then run:
+Some configuration may require restarting Apache using the following command:
 
-kill process_id
-rm /var/rails/myexperiment/tmp/pids/mongrel.pid
-ruby var/rails/myexperiment/script/server -d
+sudo service httpd restart
 
-== Outstanding issues ==
-Sending email generating by myExperiment has yet to be sorted out.
+
+== Further Information ==
+
+Please refer to the wiki page:
+
+	http://wiki.myexperiment.org/index.php/Developer:FedoraInstallation

Modified: branches/datasets/installers/ubuntu/README.txt (2907 => 2908)


--- branches/datasets/installers/ubuntu/README.txt	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/installers/ubuntu/README.txt	2012-01-19 10:38:36 UTC (rev 2908)
@@ -47,3 +47,11 @@
 Some configuration may require restarting Apache using the following command:
 
 sudo apache2ctl restart
+
+
+== Further Information ==
+
+Please refer to the wiki page:
+
+        http://wiki.myexperiment.org/index.php/Developer:UbuntuInstallation
+

Modified: branches/datasets/installers/ubuntu/install.bash (2907 => 2908)


--- branches/datasets/installers/ubuntu/install.bash	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/installers/ubuntu/install.bash	2012-01-19 10:38:36 UTC (rev 2908)
@@ -16,7 +16,7 @@
 
 echo "Installing required APT packages"
 sudo apt-get update || { echo "Could not update apt-get. Aborting ..."; exit 4; }
-sudo -n apt-get install -y build-essential exim4 ruby ruby1.8-dev libzlib-ruby rdoc irb rubygems rake apache2 apache2-dev libapache2-mod-fcgid libfcgi-ruby1.8 libmysql-ruby gcj-4.4-jre-headless subversion libopenssl-ruby1.8 libcurl3 libcurl3-gnutls libcurl4-openssl-dev mysql-server graphicsmagick imagemagick librmagick-ruby1.8 libmagick9-dev graphviz mlocate wget || { echo "Could not install required APT packages. Aborting ..."; exit 5; }
+sudo -n apt-get install -y build-essential exim4 ruby ruby1.8-dev libzlib-ruby rdoc irb rubygems rake apache2 apache2-dev libapache2-mod-fcgid libfcgi-ruby1.8 libmysql-ruby gcj-4.4-jre-headless subversion libopenssl-ruby1.8 libcurl3 libcurl3-gnutls libcurl4-openssl-dev mysql-server graphicsmagick imagemagick librmagick-ruby1.8 libmagick9-dev graphviz mlocate || { echo "Could not install required APT packages. Aborting ..."; exit 5; }
 
 echo "Installing Rake version ${rake_version} and Rails version ${rails_version} Ruby Gems"
 sudo gem install rake ${nordoc} ${nori} --version ${rake_version} || { echo "Could not install Rake Ruby Gem (version ${rake_version}). Aborting ..."; exit 6; }
@@ -30,12 +30,14 @@
 	DOLLAR='$'; echo -e "export PATH=${DOLLAR}PATH:/var/lib/gems/1.8/bin\nalias sudo='sudo env PATH=${DOLLAR}PATH'" >> /home/${USER}/.bashrc || { echo "Could not write to /home/${USER}/.bashrc.  Aborting ..."; exit 9;}
 	source /home/${USER}/.bashrc || { echo "Could not source /home/${USER}/.bashrc.  Aborting ..."; exit 10; }
 fi
-sudo gem install ${nordoc} ${nori} mongrel_cluster rubyzip oauth libxml-ruby rmagick dsl_accessor ruby-openid openurl curb marc || { echo "Could not install all remaining generic Ruby Gems required by myExperiment. Aborting ..."; exit 11; }
+sudo gem install ${nordoc} ${nori} rubyzip libxml-ruby rmagick dsl_accessor ruby-openid openurl curb marc || { echo "Could not install all remaining generic Ruby Gems required by myExperiment. Aborting ..."; exit 11; }
 
-echo "Making OAuth Ruby Gem compatible with Rails ${rails_version}"
+echo "Patching bug in Ubuntu 10.04 version of Ruby 1.8.7"
 tempdir=$(mktemp -d /tmp/myexp_installer.XXXXXXXXXX) || { echo "Could not create temporary file for writing patches to. Aborting ..."; exit 12; }
 cd ${tempdir} || { echo "Could not find temporary directory. Aborting ..."; exit 13; }
 echo "${net_http_patch}" > net_http.patch || { echo "Could not write net/http patch file. Aborting ..."; exit 14; }
+
+echo "Patching settings file to provide minimal configuration"
 echo "${settings_patch}" > settings.patch || { echo "Could not write settings patch file. Aborting ..."; exit 15; }
 sudo updatedb || { echo "Could not run updatedb so that http.rb that needs updating can be located. Aborting ..."; exit 16; }
 net_http_file=`locate net/http.rb`

Modified: branches/datasets/lib/conf.rb (2907 => 2908)


--- branches/datasets/lib/conf.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/lib/conf.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -179,8 +179,8 @@
 
   def self.layouts
     #TODO: Perhaps implement code that can load different/extra settings files based on current environment
-    layouts = self.fetch_entry('layouts')
-    layouts ? layouts.delete_if {|k,v| v["environment"] && (v["environment"] != ENV["RAILS_ENV"])} : {}
+    layouts = self.fetch_entry('layouts') || {}
+    layouts.delete_if {|k,v| v["environment"] && (v["environment"] != ENV["RAILS_ENV"])}
   end
 
   # This method is required to create an administrator in the test fixtures

Modified: branches/datasets/lib/previews.rb (2907 => 2908)


--- branches/datasets/lib/previews.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/lib/previews.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -5,7 +5,7 @@
 
     self.class_eval do
 
-      belongs_to :preview
+      belongs_to :preview, :dependent => :destroy
 
       def image
         preview.image_blob.data if preview && preview.image_blob

Modified: branches/datasets/lib/rest.rb (2907 => 2908)


--- branches/datasets/lib/rest.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/lib/rest.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -262,7 +262,12 @@
               if query['version'] and model_data['Versioned'][i] == 'yes'
                 text = eval("ob.find_version(#{query['version']}).#{accessor}").to_s
               else
-                text = eval("ob.#{accessor}").to_s
+                val = eval("ob.#{accessor}")
+		if val.class == ActiveSupport::TimeWithZone
+                   text = val.time().to_s
+                else
+                   text = val.to_s
+                end
               end
             end
           end
@@ -557,8 +562,8 @@
 
   case ob.class.name
     when 'Workflow';               return workflow_url(ob)
-    when 'Blob';                   return file_url(ob)
-    when 'Network';                return group_url(ob)
+    when 'Blob';                   return blob_url(ob)
+    when 'Network';                return network_url(ob)
     when 'User';                   return user_url(ob)
     when 'Review';                 return workflow_review_url(ob.reviewable, ob)
     when 'Comment';                return "#{rest_resource_uri(ob.commentable)}/comments/#{ob.id}"

Modified: branches/datasets/lib/smtp_tls.rb (2907 => 2908)


--- branches/datasets/lib/smtp_tls.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/lib/smtp_tls.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -5,8 +5,14 @@
   private
   def do_start(helodomain, user, secret, authtype)
     raise IOError, 'SMTP session already started' if @started
-    check_auth_args user, secret, authtype if user or secret
 
+    # http://blog.inspired.no/smtp-error-while-using-gmail-in-rails-271/
+    if RUBY_VERSION > "1.8.6"
+      check_auth_args user, secret # for rails 1.8.7
+    else
+      check_auth_args user, secret, authtype if user or secret
+    end
+
     sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
     @socket = Net::InternetMessageIO.new(sock)
     @socket.read_timeout = 60 address@hidden

Modified: branches/datasets/lib/taverna_to_galaxy.rb (2907 => 2908)


--- branches/datasets/lib/taverna_to_galaxy.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/lib/taverna_to_galaxy.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -5,9 +5,8 @@
 
 require 'zip/zip'
 require 'workflow-to-galaxy'
+require 'myexperiment-rest'
 
-include Generator
-
 module TavernaToGalaxy
 
   def self.generate(workflow, version, t2_server, zip_file_name)
@@ -15,21 +14,21 @@
     wv = workflow.find_version(version)
 
     doc = XML::Document.new
+
     doc.root = XML::Node.new("workflow")
-    doc.root << wv.components
 
-    wkf_title   = wv.title
-    wkf_descr   = wv.body
-    wkf_inputs  = get_IOData(doc, "source")
-    wkf_outputs = get_IOData(doc, "sink")
+    doc.root << (XML::Node.new("title") << wv.title)
+    doc.root << (XML::Node.new("description") << wv.body)
+    doc.root << (XML::Node.new("content-uri") << workflow.named_download_url)
+    doc.root << (XML::Node.new("uploader")    << workflow.contributor.label)
 
-    w2g_workflow = W2GWorkflow.new(nil, wkf_title, wkf_descr, wkf_inputs, wkf_outputs)
+    doc.root << wv.components
 
-    w2g_rest_object = W2GRestObject.new("#{workflow.named_download_url}?version=#{version}", w2g_workflow)
+    response = MyExperimentREST::MyExperimentWorkflow.parse(doc.root.to_s)
 
     # Set output files
-    xml_file    = wv.unique_name + ".xml"
-    script_file = wv.unique_name + ".rb"
+    xml_file = wv.unique_name + ".xml"
+    rb_file  = wv.unique_name + ".rb"
 
     # Set taverna server if not specified
     t2_server = "http://localhost:8980/taverna-server"  if t2_server == ""
@@ -37,98 +36,22 @@
     # Generate Galaxy tool's files
     zip_file = Zip::ZipFile.open(zip_file_name, Zip::ZipFile::CREATE)
 
-    zip_file.get_output_stream(xml_file) do |stream|
-      generate_xml(w2g_rest_object, xml_file, stream)
-    end
+    zip_file.get_output_stream(xml_file) do |xml_stream|
+      zip_file.get_output_stream(rb_file) do |rb_stream|
 
-    zip_file.get_output_stream(script_file) do |stream|
-      generate_script(w2g_rest_object, t2_server, stream)
-    end
+        tool = WorkflowToGalaxy::GalaxyTool.new(
+          :wkf_source => WorkflowToGalaxy::Workflows::MYEXPERIMENT_TAVERNA2,
+          :params => {
+            :t2_server => t2_server,
+            :xml_out   => xml_stream,
+            :rb_out    => rb_stream,
+            :response  => response })
 
-    zip_file.close
-  end
-
-  #
-  # Populate _IOData_ objects for specified type: value +source+'+ is for inputs
-  # and +sink+ for outputs
-  #
-  def self.get_IOData(doc, type)
-    io_data = []
-
-    # Get all sources or sinks and create appropriate objects
-    doc.find("//workflow/components/dataflows/address@hidden'top']/#{type}s/#{type}").each do |node|
-      name = ''
-      descriptions = []
-      examples = []
-
-      node.each_element do |n|
-        if n.name.eql? "name"
-          name = n.children[0].to_s
-        elsif n.name.eql? "descriptions"
-          n.each_element do |d|
-            descriptions << d.children[0].to_s
-          end if n.children?
-        elsif n.name.eql? "examples"
-          n.each_element do |e|
-            examples << e.children[0].to_s
-          end if n.children?
-        end
+        tool.generate
       end
-
-      io_data << W2GIOData.new(name, descriptions, examples)
     end
 
-    io_data
+    zip_file.close
   end
-
-  class W2GRestObject
-
-    attr_reader(:uri, :workflow)
-
-    def initialize(uri, workflow)
-      @uri      = uri
-      @workflow = workflow
-    end
-
-  end
-
-  #
-  # Contains all available information about a workflow: _xml_uri_, _title_, _description_,
-  # _inputs_ and _outputs_. The _xml_uri_ specifies the XML description on myExperiment and
-  # not the XML of the workflow itself.
-  #
-  class W2GWorkflow
-
-    attr_reader(:xml_uri, :title, :description, :inputs, :outputs)
-
-    def initialize(xml_uri, title, description, inputs, outputs)
-      @xml_uri     = xml_uri
-      @title       = title
-      @description = description
-      @inputs      = inputs
-      @outputs     = outputs
-    end
-
-  end
-
-  #
-  # Contains all available information about an input or output: name, descriptions
-  # and examples. The last two are lists.
-  #--
-  # Currently both inputs and outputs contain the same information. If that
-  # changes we can subclass this one.
-  #
-  class W2GIOData
-
-    attr_reader(:name, :descriptions, :examples)
-
-    def initialize(name, descriptions, examples)
-      @name         = name
-      @descriptions = descriptions
-      @examples     = examples
-    end
-
-  end
-
 end
 

Deleted: branches/datasets/resolr.sh (2907 => 2908)


--- branches/datasets/resolr.sh	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/resolr.sh	2012-01-19 10:38:36 UTC (rev 2908)
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-export RAILS_ENV=production
-
-echo 'Workflow.rebuild_solr_index' | ruby script/console
-echo 'Blob.rebuild_solr_index'     | ruby script/console
-echo 'User.rebuild_solr_index'     | ruby script/console
-echo 'Network.rebuild_solr_index'  | ruby script/console
-echo 'Pack.rebuild_solr_index'     | ruby script/console
-

Modified: branches/datasets/test/functional/blobs_controller_test.rb (2907 => 2908)


--- branches/datasets/test/functional/blobs_controller_test.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/test/functional/blobs_controller_test.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -33,7 +33,7 @@
                   :attributions_files => ''
 
     assert_equal old_count+1, Blob.count
-    assert_redirected_to file_path(assigns(:blob))
+    assert_redirected_to blob_path(assigns(:blob))
   end
 
   def test_should_show_blob
@@ -56,7 +56,7 @@
                            :attributions_workflows => '',
                            :attributions_files => ''
 
-    assert_redirected_to file_path(assigns(:blob))
+    assert_redirected_to blob_path(assigns(:blob))
   end
   
   def test_should_destroy_blob
@@ -66,6 +66,6 @@
     delete :destroy, :id => 1
 
     assert_equal old_count-1, Blob.count   
-    assert_redirected_to files_path
+    assert_redirected_to blobs_path
   end
 end

Modified: branches/datasets/test/functional/group_announcements_controller_test.rb (2907 => 2908)


--- branches/datasets/test/functional/group_announcements_controller_test.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/test/functional/group_announcements_controller_test.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -5,13 +5,13 @@
   fixtures :group_announcements, :networks, :users
 
   def test_should_get_index
-    get :index, :group_id => networks(:dilbert_appreciation_network).id
+    get :index, :network_id => networks(:dilbert_appreciation_network).id
     assert_response :success
   end
 
   def test_should_get_new
     login_as(:john)
-    get :new, :group_id => networks(:dilbert_appreciation_network).id
+    get :new, :network_id => networks(:dilbert_appreciation_network).id
     assert assigns(:announcement)
     assert_response :success
   end
@@ -20,7 +20,7 @@
     old_count = GroupAnnouncement.count
 
     login_as(:john)
-    post :create, :group_id => networks(:dilbert_appreciation_network).id, :announcement => { :title => 'MyAnnouncement', :body => 'Announcement body', :public => '1' }
+    post :create, :network_id => networks(:dilbert_appreciation_network).id, :announcement => { :title => 'MyAnnouncement', :body => 'Announcement body', :public => '1' }
 
     assert_equal old_count+1, GroupAnnouncement.count
     assert assigns(:announcement)
@@ -28,19 +28,19 @@
   end
 
   def test_should_show_group_announcement
-    get :show, :group_id => networks(:dilbert_appreciation_network).id, :id => group_announcements(:dilbert_network_public_announcement).id
+    get :show, :network_id => networks(:dilbert_appreciation_network).id, :id => group_announcements(:dilbert_network_public_announcement).id
     assert_response :success
   end
 
   def test_should_get_edit
     login_as(:john)
-    get :edit, :group_id => networks(:dilbert_appreciation_network).id, :id => 1
+    get :edit, :network_id => networks(:dilbert_appreciation_network).id, :id => 1
     assert_response :success
   end
   
   def test_should_update_group_announcement
     login_as(:john)
-    put :update, :group_id => networks(:dilbert_appreciation_network).id, :id => 1, :announcement => { :title => 'MyNewTitle' }
+    put :update, :network_id => networks(:dilbert_appreciation_network).id, :id => 1, :announcement => { :title => 'MyNewTitle' }
     assert_redirected_to group_announcement_path(networks(:dilbert_appreciation_network).id, assigns(:announcement))
   end
   
@@ -48,7 +48,7 @@
     old_count = GroupAnnouncement.count
 
     login_as(:john)
-    delete :destroy, :group_id => networks(:dilbert_appreciation_network).id, :id => 1
+    delete :destroy, :network_id => networks(:dilbert_appreciation_network).id, :id => 1
 
     assert_equal old_count-1, GroupAnnouncement.count
     assert_redirected_to group_announcements_path(networks(:dilbert_appreciation_network).id)

Modified: branches/datasets/test/functional/memberships_controller_test.rb (2907 => 2908)


--- branches/datasets/test/functional/memberships_controller_test.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/test/functional/memberships_controller_test.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -62,7 +62,7 @@
     login_as(:john)
     delete :destroy, :id => networks(:another_network).id, :user_id => users(:john).id
 
-    assert_redirected_to group_path(networks(:another_network).id )
+    assert_redirected_to network_path(networks(:another_network).id )
     assert_equal old_count-1, Membership.count
   end
 

Modified: branches/datasets/test/functional/networks_controller_test.rb (2907 => 2908)


--- branches/datasets/test/functional/networks_controller_test.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/test/functional/networks_controller_test.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -29,7 +29,7 @@
     post :create, :network => { :user_id => '990', :title => 'test network', :unique_name => 'test_network', :new_member_policy => 'open', :description => "..." }
 
     assert_equal old_count+1, Network.count    
-    assert_redirected_to group_path(assigns(:network))
+    assert_redirected_to network_path(assigns(:network))
   end
 
   def test_should_show_network
@@ -49,7 +49,7 @@
     put :update, :id => 1, 
                  :network => { :user_id => '990', :title => 'test network', :unique_name => 'update_network', :new_member_policy => 'open', :description => ".?."}
 
-    assert_redirected_to group_path(assigns(:network))
+    assert_redirected_to network_path(assigns(:network))
   end
   
   def test_should_destroy_network
@@ -59,6 +59,6 @@
     delete :destroy, :id => 1
 
     assert_equal old_count-1, Network.count   
-    assert_redirected_to groups_path
+    assert_redirected_to networks_path
   end
 end

Modified: branches/datasets/vendor/plugins/acts_as_solr/lib/class_methods.rb (2907 => 2908)


--- branches/datasets/vendor/plugins/acts_as_solr/lib/class_methods.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/vendor/plugins/acts_as_solr/lib/class_methods.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -100,7 +100,7 @@
         if options[:results_format] == :objects
           docs.each{|doc| k = doc.fetch('id').to_s.split(':'); result << k[0].constantize.find_by_id(k[1])}
         elsif options[:results_format] == :ids
-          docs.each{|doc| result << {"id"=>doc.values.pop.to_s}}
+          docs.each{|doc| result << {"id"=>doc['id'].pop}}
         end
         SearchResults.new :docs => result, :total => data.total
       end
@@ -155,4 +155,4 @@
     end
   end
   
-end
\ No newline at end of file
+end

Modified: branches/datasets/vendor/plugins/oauth_plugin/init.rb (2907 => 2908)


--- branches/datasets/vendor/plugins/oauth_plugin/init.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/vendor/plugins/oauth_plugin/init.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -1,4 +1,4 @@
-gem 'oauth', '>=0.2.1'
+#gem 'oauth', '>=0.2.1'
 require 'oauth/signature/hmac/sha1'
 require 'oauth/request_proxy/action_controller_request'
 require 'oauth/server'

Modified: branches/datasets/vendor/plugins/structured_data/lib/auto_migrate.rb (2907 => 2908)


--- branches/datasets/vendor/plugins/structured_data/lib/auto_migrate.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/vendor/plugins/structured_data/lib/auto_migrate.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -11,7 +11,7 @@
   SCHEMA              = "config/base_schema.xml"
   SCHEMA_D            = "config/schema.d"
   COLUMN_ATTRIBUTES     = ['name', 'type', 'default', 'limit', 'null']
-  BELONGS_TO_ATTRIBUTES = ['polymorphic', 'class_name', 'foreign_key']
+  BELONGS_TO_ATTRIBUTES = ['polymorphic', 'class_name', 'foreign_key', 'dependent']
   HAS_MANY_ATTRIBUTES   = ['target', 'through', 'foreign_key', 'source', 'dependent', 'conditions', 'class_name', 'as']
 
   def self.schema

Modified: branches/datasets/vendor/plugins/structured_data/lib/structured_data.rb (2907 => 2908)


--- branches/datasets/vendor/plugins/structured_data/lib/structured_data.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/vendor/plugins/structured_data/lib/structured_data.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -39,6 +39,7 @@
           bits.push(":polymorphic => #{association[:polymorphic]}") if association[:polymorphic]
           bits.push(":class_name => \"#{association[:class_name]}\"") if association[:class_name]
           bits.push(":foreign_key => :#{association[:foreign_key]}") if association[:foreign_key]
+          bits.push(":dependent => :#{association[:dependent]}") if association[:dependent]
 
           line = "belongs_to #{bits.join(', ')}"
           self.class_eval(line)

Modified: branches/datasets/vendor/plugins/white_list_formatted_content/init.rb (2907 => 2908)


--- branches/datasets/vendor/plugins/white_list_formatted_content/init.rb	2012-01-19 09:54:33 UTC (rev 2907)
+++ branches/datasets/vendor/plugins/white_list_formatted_content/init.rb	2012-01-19 10:38:36 UTC (rev 2908)
@@ -1,7 +1,7 @@
 ActiveRecord::Base.class_eval do
-  include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper
+  include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper, ActionView::Helpers::UrlHelper
   def self.format_attribute(attr_name)
-    class << self; include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper; end
+    class << self; include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper, ActionView::Helpers::UrlHelper; end
     define_method(:body)       { read_attribute attr_name }
     define_method(:body_html)  { read_attribute "#{attr_name}_html" }
     define_method(:body_html=) { |value| write_attribute "#{attr_name}_html", value }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]