stonepath 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -2,14 +2,13 @@ module StonePath
2
2
  module EventLogging
3
3
 
4
4
  def log_events
5
- has_many :logged_events, :as => :auditable, :class_name => "EventRecord"
5
+ has_many :logged_events, :as => :auditable, :class_name => "EventRecord", :order => "created_at"
6
6
 
7
7
  define_method :aasm_event_fired do |event_name, old_state_name, new_state_name|
8
- current_user_id = User.current
9
8
  self.logged_events.create(:event_name => event_name.to_s,
10
9
  :old_state_name => old_state_name.to_s,
11
10
  :new_state_name => new_state_name.to_s,
12
- :user_id => current_user_id)
11
+ :user => User.current)
13
12
  end
14
13
  end
15
14
  end
@@ -17,7 +17,8 @@ module StonePath
17
17
  end
18
18
 
19
19
  def tasked_through(tasks, options={})
20
- has_many tasks, :as => :workitem
20
+ options.merge!(:as => :workitem)
21
+ has_many tasks, options
21
22
  end
22
23
 
23
24
  end #base.instance_eval
@@ -1,6 +1,6 @@
1
1
  class EventRecord < ActiveRecord::Base
2
2
  belongs_to :auditable, :polymorphic => true
3
-
3
+ belongs_to :user
4
4
  # the user_id field will point to the id of the current_user set by the controller
5
5
  # hack. feel free to add our own finder here using that.
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stonepath
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Bock
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-10 00:00:00 -05:00
12
+ date: 2010-03-14 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency