<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,6 +2,7 @@ Edge
 ----
 
 * Replaced own sharing code by acts_as_shareable plugin. Please, install acts_as_shareable and it's migration before running plugins migrations.
+* Acts_as_state_machine code replaced by AASM gem
 
 0.5.4
 ----</diff>
      <filename>CHANGELOG.md</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ class Member::GroupsController &lt; Member::BaseController
     @group.save
 
     @group.join(current_user, true)
-    @group.activate_membership(current_user)
+#    @group.activate_membership(current_user)
 
     if @group.errors.empty?
       if current_user.admin == true || Tog::Config['plugins.tog_social.group.moderation.creation'] != true</diff>
      <filename>app/controllers/member/groups_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -43,10 +43,12 @@ class Group &lt; ActiveRecord::Base
   acts_as_taggable
   seo_urls
 
-  acts_as_state_machine :initial =&gt; :pending
-  state :pending, :enter =&gt; :make_activation_code
-  state :active,  :enter =&gt; :do_activate
-  event :activate do
+  include AASM
+  aasm_column :state
+  aasm_initial_state :pending
+  aasm_state :pending, :enter =&gt; :make_activation_code
+  aasm_state :active,  :enter =&gt; :do_activate
+  aasm_event :activate do
     transitions :from =&gt; :pending, :to =&gt; :active
   end
 
@@ -143,7 +145,7 @@ class Group &lt; ActiveRecord::Base
   def do_activate
     self.activated_at = Time.now.utc
     self.activation_code = nil
-    self.moderator_memberships.each{|mod| mod.activate!}
+    self.moderator_memberships.each{|mod| mod.activate! unless mod.active?}
   end
 
   def set_default_image</diff>
      <filename>app/models/group.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,17 +5,20 @@ class Membership &lt; ActiveRecord::Base
   
   record_activity_of :user
   
-  acts_as_state_machine :initial =&gt; :pending
-  state :pending, :enter =&gt; :make_activation_code
-  state :active, :enter =&gt; :do_activate
-  state :invited
-  event :activate do
+  include AASM
+  aasm_column :state
+  aasm_initial_state :pending
+  aasm_state :pending, :enter =&gt; :make_activation_code
+  aasm_state :active, :enter =&gt; :do_activate
+  aasm_state :invited
+  
+  aasm_event :activate do
     transitions :from =&gt; :pending, :to =&gt; :active
   end
-  event :invite do
+  aasm_event :invite do
     transitions :from =&gt; :pending, :to =&gt; :invited
   end
-  event :accept_invitation do
+  aasm_event :accept_invitation do
     transitions :from =&gt; :invited, :to =&gt; :active
   end
   </diff>
      <filename>app/models/membership.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@
 
 resources :profiles
 
-resources :streams, :only =&gt; [:index, :show]
+resources :streams, :only =&gt; [:index, :show], :member =&gt; {:network =&gt; :get}
 
 with_options(:controller =&gt; 'groups') do |group|
   group.tag_groups       '/groups/tag/:tag',                         :action =&gt; 'tag'
@@ -27,10 +27,10 @@ namespace(:member) do |member|
     friendship.unfollow_user  '/unfollow/:friend_id',       :action =&gt; 'unfollow'
   end
   member.with_options(:controller =&gt; 'sharings') do |sharing|
-    sharing.share '/sharings/share/:group_id/:shareable_type/:shareable_id', :action =&gt; 'create', :method =&gt; :post    
+    sharing.share '/sharings/share/:group_id/:shareable_type/:shareable_id', :action =&gt; 'create', :conditions =&gt; { :method =&gt; :post }    
     sharing.new_sharing '/sharings/:shareable_type/:shareable_id/new', :action =&gt; 'new'
     sharing.sharings '/sharings', :action =&gt; 'index'
-    sharing.destroy_sharing '/sharings/:group_id/:id', :action =&gt; 'destroy', :method =&gt; :delete      
+    sharing.destroy_sharing '/sharings/:group_id/:id', :action =&gt; 'destroy', :conditions =&gt; { :method =&gt; :delete }      
 #    sharing.destroy_sharing '/group/:id/remove/:shareable_type/:shareable_id', :action =&gt; 'destroy', :method =&gt; :delete  
   end
 end</diff>
      <filename>config/desert_routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 require_plugin 'tog_core'
-require_plugin 'acts_as_state_machine'
+#require_plugin 'acts_as_state_machine'
 require_plugin 'seo_urls'
 require_plugin 'paperclip'
 require_plugin 'acts_as_shareable'</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,20 @@ class Member::SharingsControllerTest &lt; ActionController::TestCase
 
       @pornfans = Factory(:group, :name =&gt; 'Porn without frontiers', :moderated =&gt; false, :author =&gt; @berlusconi)
     end
+    
+    context &quot;can GET his sharings&quot; do
+      setup do
+        @pornfans.join(@berlusconi, true)
+        @sharing = @pornfans.share(@berlusconi, @berlusconi.profile.class.to_s, @berlusconi.profile.id)
+        get :index
+      end 
+    
+      should_assign_to :sharings
+      
+      should &quot;include all his sharings&quot; do
+        assert assigns(:sharings).include?(@sharing) 
+      end      
+    end
 
     context &quot;member of a group&quot; do
       setup do</diff>
      <filename>test/functional/member/sharings_controller_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>71db775a72fdd00d2101a70d9667f87a61f7c57a</id>
    </parent>
  </parents>
  <author>
    <name>molpe</name>
    <email>alberto.molpeceres@gmail.com</email>
  </author>
  <url>http://github.com/tog/tog_social/commit/baf89720352517842dafb66fb8bc2e4182930cbb</url>
  <id>baf89720352517842dafb66fb8bc2e4182930cbb</id>
  <committed-date>2009-10-21T06:41:45-07:00</committed-date>
  <authored-date>2009-10-21T06:41:45-07:00</authored-date>
  <message>upgrading to AASM</message>
  <tree>d2d779434bcc62b09f6e8e7f8a0190f743c5d73b</tree>
  <committer>
    <name>molpe</name>
    <email>alberto.molpeceres@gmail.com</email>
  </committer>
</commit>
