Permalink
Browse files

acts_as_reader: Using inverse_of (available since Rails 2.3.6)

  • Loading branch information...
ledermann committed Feb 29, 2012
1 parent 1786e1a commit acac8698fd0c08cca38952d481e4080dfcd8c636
Showing with 3 additions and 2 deletions.
  1. +1 −0 changelog.md
  2. +1 −1 lib/unread/acts_as_readable.rb
  3. +1 −1 unread.gemspec
View
@@ -1,6 +1,7 @@
0.0.7 - not yet released
* Cleanup files
+* acts_as_reader: Using inverse_of (available since Rails 2.3.6)
0.0.6 - 2011/11/11
@@ -7,7 +7,7 @@ module ActsAsReadable
def acts_as_reader
ReadMark.belongs_to :user, :class_name => self.to_s
- has_many :read_marks, :dependent => :delete_all, :foreign_key => 'user_id'
+ has_many :read_marks, :dependent => :delete_all, :foreign_key => 'user_id', :inverse_of => :user_id
after_create do |user|
(ReadMark.readable_classes || []).each do |klass|
View
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_dependency 'activerecord', '>= 2.3'
+ s.add_dependency 'activerecord', '>= 2.3.6'
s.add_development_dependency 'rake'
s.add_development_dependency 'mocha'

0 comments on commit acac869

Please sign in to comment.