Skip to content
Browse files

Fixing the named scope issue by using an anonymous scope.

  • Loading branch information...
1 parent 1485151 commit 3a92a1b9aa3df0d3420c13d84ea7b07fb012c132 @benzittlau benzittlau committed Mar 28, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/paper_trail/version.rb
View
6 lib/paper_trail/version.rb
@@ -2,9 +2,9 @@ class Version < ActiveRecord::Base
belongs_to :item, :polymorphic => true
validates_presence_of :event
- scope :with_item_keys, lambda { |item_type, item_id|
- where(:item_type => item_type, :item_id => item_id)
- }
+ def self.with_item_keys(item_type, item_id)
+ scoped(:conditions => { :item_type => item_type, :item_id => item_id })
+ end
scope :subsequent, lambda { |version|
where(["id > ?", version.is_a?(self) ? version.id : version]).order("id ASC")

0 comments on commit 3a92a1b

Please sign in to comment.
Something went wrong with that request. Please try again.