acts_as_sourceable 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,10 +31,10 @@ module ActsAsSourceable
31
31
  scope :unsourced, where(options[:cache_column] => false)
32
32
  elsif options[:through]
33
33
  scope :sourced, joins(options[:through]).uniq
34
- scope :unsourced, where("#{table_name}.id NOT IN (#{sourced.select("#{table_name}.id").to_sql})")
34
+ scope :unsourced, joins("LEFT OUTER JOIN (#{sourced.to_sql}) sourced ON sourced.id = #{table_name}.id").where("sourced.id IS NULL")
35
35
  else
36
36
  scope :sourced, joins(:sourceable_registry_entries).uniq
37
- scope :unsourced, where("#{table_name}.id NOT IN (#{sourced.select("#{table_name}.id").to_sql})")
37
+ scope :unsourced, joins("LEFT OUTER JOIN (#{sourced.to_sql}) sourced ON sourced.id = #{table_name}.id").where("sourced.id IS NULL")
38
38
  end
39
39
 
40
40
  # Add a way of finding everything sourced by a particular set of records
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_sourceable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  version: '0'
44
44
  requirements: []
45
45
  rubyforge_project:
46
- rubygems_version: 1.8.25
46
+ rubygems_version: 1.8.24
47
47
  signing_key:
48
48
  specification_version: 3
49
49
  summary: perform garbage collection on categories that are no longer referenced