myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3102] branches/events/app/controllers: added eve


From: noreply
Subject: [myexperiment-hackers] [3102] branches/events/app/controllers: added events for announcements and user registration
Date: Thu, 23 Aug 2012 13:36:02 +0000 (UTC)

Revision
3102
Author
dgc
Date
2012-08-23 13:36:02 +0000 (Thu, 23 Aug 2012)

Log Message

added events for announcements and user registration

Modified Paths

Diff

Modified: branches/events/app/controllers/announcements_controller.rb (3101 => 3102)


--- branches/events/app/controllers/announcements_controller.rb	2012-08-23 13:34:24 UTC (rev 3101)
+++ branches/events/app/controllers/announcements_controller.rb	2012-08-23 13:36:02 UTC (rev 3102)
@@ -50,6 +50,7 @@
     params[:announcement][:user_id] = current_user.id
     @announcement = Announcement.new(params[:announcement])
     if @announcement.save
+      Event.create(:subject => current_user, :action ="" 'create', :objekt => @announcement)
       flash[:notice] = 'Announcement was successfully created.'
       redirect_to :action ="" 'index'
     else
@@ -64,6 +65,7 @@
   def update
     @announcement = Announcement.find(params[:id])
     if @announcement.update_attributes(params[:announcement])
+      Event.create(:subject => current_user, :action ="" 'edit', :objekt => @announcement)
       flash[:notice] = 'Announcement was successfully updated.'
       redirect_to :action ="" 'show', :id => @announcement
     else

Modified: branches/events/app/controllers/application_controller.rb (3101 => 3102)


--- branches/events/app/controllers/application_controller.rb	2012-08-23 13:34:24 UTC (rev 3101)
+++ branches/events/app/controllers/application_controller.rb	2012-08-23 13:36:02 UTC (rev 3102)
@@ -344,7 +344,7 @@
     
   end
   
-  def update_attributions(attributable, params)
+  def update_attributions(attributable, params, user)
     
     # First delete old attributions:
     attributable.attributors.each do |a|

Modified: branches/events/app/controllers/blobs_controller.rb (3101 => 3102)


--- branches/events/app/controllers/blobs_controller.rb	2012-08-23 13:34:24 UTC (rev 3101)
+++ branches/events/app/controllers/blobs_controller.rb	2012-08-23 13:36:02 UTC (rev 3102)
@@ -164,7 +164,7 @@
           update_layout(@blob, params[:layout])
         
           update_credits(@blob, params)
-          update_attributions(@blob, params)
+          update_attributions(@blob, params, current_user)
         
           if policy_err_msg.blank?
 
@@ -222,7 +222,7 @@
         
         policy_err_msg = update_policy(@blob, params)
         update_credits(@blob, params)
-        update_attributions(@blob, params)
+        update_attributions(@blob, params, current_user)
         update_layout(@blob, params[:layout])
         
         if policy_err_msg.blank?

Modified: branches/events/app/controllers/users_controller.rb (3101 => 3102)


--- branches/events/app/controllers/users_controller.rb	2012-08-23 13:34:24 UTC (rev 3101)
+++ branches/events/app/controllers/users_controller.rb	2012-08-23 13:36:02 UTC (rev 3102)
@@ -318,6 +318,7 @@
       user.errors.full_messages.each { |e| logger.error(e) } 
       #END DEBUG
       if confirmed
+        Event.create(:subject => user, :action ="" 'register')
         self.current_user = user
         self.current_user.process_pending_invitations! # look up any pending invites for this user + transfer them to relevant tables from 'pending_invitations' table
         confirmed = false if !logged_in?

reply via email to

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