redcrumbs 0.4.0 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,6 +4,8 @@ Fast and unobtrusive activity tracking of ActiveRecord models using Redis and Da
4
4
 
5
5
  Redcrumbs is designed for high-traffic applications that need to track changes to their tables without making additional writes to the database. It is especially useful where the saved history needs to be expired over time and is not mission critical data. The emphasis is on reducing response times and easing the load on your main database.
6
6
 
7
+ Note: Now compatible with Rails 3.1+ only.
8
+
7
9
  User context is built in and fully customisable and this makes Redcrumbs particularly useful for reporting relevant activity to users as it happens in your app.
8
10
 
9
11
  Redcrumbs is used for the 'News' feature in Project Zebra games but could also be used as the basis of a fast versioning or reporting system.
@@ -19,9 +19,7 @@ module Redcrumbs
19
19
  end
20
20
 
21
21
  def subject_from_storage
22
- self._subject ||= new_subject = subject_type.constantize.new(self.stored_subject.reject {|attribute| [:id].include?(attribute.to_sym)})
23
- self._subject.id ||= self.stored_subject["id"] if self._subject.has_attribute?(:id) && self.stored_subject.has_key?("id")
24
- self._subject
22
+ self._subject ||= subject_type.constantize.new(self.stored_subject, :without_protection => true)
25
23
  end
26
24
 
27
25
  def creator
@@ -37,9 +35,7 @@ module Redcrumbs
37
35
  end
38
36
 
39
37
  def initialize_creator_from_hash_of_attributes
40
- self._creator ||= creator_class.new(self.stored_creator.reject {|attribute| [:id].include?(attribute.to_sym)})
41
- self._creator.id ||= self.stored_creator["id"] if self._creator.has_attribute?(:id) && self.stored_creator.has_key?("id")
42
- self._creator
38
+ self._creator ||= creator_class.new(self.stored_creator, :without_protection => true)
43
39
  end
44
40
 
45
41
  # grabbing full creator/target should cache the result. Check to see is it a new_record (i.e. from storage) first
@@ -60,9 +56,7 @@ module Redcrumbs
60
56
  end
61
57
 
62
58
  def initialize_target_from_hash_of_attributes
63
- self._target ||= target_class.new(self.stored_target.reject {|attribute| [:id].include?(attribute.to_sym)})
64
- self._target.id ||= self.stored_target["id"] if self._target.has_attribute?(:id) && self.stored_target.has_key?("id")
65
- self._target
59
+ self._target ||= target_class.new(self.stored_target, :without_protection => true)
66
60
  end
67
61
 
68
62
  def target_class
@@ -1,3 +1,3 @@
1
1
  module Redcrumbs
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redcrumbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-13 00:00:00.000000000 +01:00
12
+ date: 2012-09-14 00:00:00.000000000 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: data_mapper
17
- requirement: &2151883460 !ruby/object:Gem::Requirement
17
+ requirement: &2151868740 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.2.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2151883460
25
+ version_requirements: *2151868740
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: dm-redis-adapter
28
- requirement: &2151878000 !ruby/object:Gem::Requirement
28
+ requirement: &2151861120 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 0.6.2
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2151878000
36
+ version_requirements: *2151861120
37
37
  description: Fast and unobtrusive activity tracking of ActiveRecord models using DataMapper
38
38
  and Redis
39
39
  email: