unread 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/changelog.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.1.1 - 2012/05/01
2
+
3
+ * Fixed handling namespaced classes. Closes #10 (thanks to @stanislaw)
4
+
1
5
  0.1.0 - 2012/04/21
2
6
 
3
7
  * Added scope "with_read_marks_for"
@@ -192,7 +192,7 @@ module Unread
192
192
 
193
193
  module ReaderInstanceMethods
194
194
  def read_mark_global(klass)
195
- instance_var_name = "@read_mark_global_#{klass.name}"
195
+ instance_var_name = "@read_mark_global_#{klass.name.gsub('::','_')}"
196
196
  instance_variable_get(instance_var_name) || begin # memoize
197
197
  obj = self.read_marks.readable_type(klass.base_class.name).global.first
198
198
  instance_variable_set(instance_var_name, obj)
@@ -1,3 +1,3 @@
1
1
  module Unread
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
data/test/test_helper.rb CHANGED
@@ -12,12 +12,15 @@ ActiveRecord::Base.establish_connection(db_name)
12
12
  ActiveRecord::Migration.verbose = false
13
13
  load(File.dirname(__FILE__) + "/schema.rb")
14
14
 
15
- class Reader < ActiveRecord::Base
16
- acts_as_reader
17
- end
15
+ module App
16
+ class Reader < ActiveRecord::Base
17
+ acts_as_reader
18
+ end
18
19
 
19
- class Email < ActiveRecord::Base
20
- acts_as_readable :on => :updated_at
20
+ class Email < ActiveRecord::Base
21
+ acts_as_readable :on => :updated_at
22
+ end
21
23
  end
24
+ include App
22
25
 
23
26
  puts "Testing with ActiveRecord #{ActiveRecord::VERSION::STRING}"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unread
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Georg Ledermann
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-04-21 00:00:00 Z
18
+ date: 2012-05-01 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activerecord
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  requirements: []
149
149
 
150
150
  rubyforge_project: unread
151
- rubygems_version: 1.8.23
151
+ rubygems_version: 1.8.24
152
152
  signing_key:
153
153
  specification_version: 3
154
154
  summary: Manages read/unread status of ActiveRecord objects