acts_as_sourceable 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/acts_as_sourceable/acts_as_sourceable.rb +2 -2
- metadata +3 -5
- data/.gitignore +0 -2
- data/acts_as_sourceable.gemspec +0 -12
@@ -27,12 +27,12 @@ module ActsAsSourceable
|
|
27
27
|
scope :unsourced, where(sourceable_cache_column => false)
|
28
28
|
else
|
29
29
|
scope :sourced, joins(:sourceable_institutions).group("#{table_name}.id")
|
30
|
-
scope :unsourced, joins("LEFT OUTER JOIN sourceable_institutions ON sourceable_id = #{
|
30
|
+
scope :unsourced, joins("LEFT OUTER JOIN sourceable_institutions ON sourceable_id = #{table_name}.id and sourceable_type = '#{self.name}'").where("sourceable_id IS NULL")
|
31
31
|
end
|
32
32
|
|
33
33
|
# Create a scope that returns record that is not used by the associations in sourceable_used_by
|
34
34
|
if sourceable_used_by
|
35
|
-
scope :unused, where(Array(sourceable_used_by).collect {|usage_association| "id NOT IN (" + select("#{table_name}.id").joins(usage_association).group("#{table_name}.id").to_sql + ")"}.join(' AND '))
|
35
|
+
scope :unused, where(Array(sourceable_used_by).collect {|usage_association| "#{table_name}.id NOT IN (" + select("#{table_name}.id").joins(usage_association).group("#{table_name}.id").to_sql + ")"}.join(' AND '))
|
36
36
|
scope :orphaned, unsourced.unused
|
37
37
|
else
|
38
38
|
scope :orphaned, unsourced
|
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: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -19,12 +19,10 @@ executables: []
|
|
19
19
|
extensions: []
|
20
20
|
extra_rdoc_files: []
|
21
21
|
files:
|
22
|
-
- .gitignore
|
23
|
-
- README.rdoc
|
24
|
-
- acts_as_sourceable.gemspec
|
25
|
-
- lib/acts_as_sourceable.rb
|
26
22
|
- lib/acts_as_sourceable/acts_as_sourceable.rb
|
27
23
|
- lib/acts_as_sourceable/sourceable_institution.rb
|
24
|
+
- lib/acts_as_sourceable.rb
|
25
|
+
- README.rdoc
|
28
26
|
homepage: http://github.com/rrn/acts_as_sourceable
|
29
27
|
licenses: []
|
30
28
|
post_install_message:
|
data/.gitignore
DELETED
data/acts_as_sourceable.gemspec
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = 'acts_as_sourceable'
|
3
|
-
s.version = '1.0.5'
|
4
|
-
s.date = %q{2010-09-16}
|
5
|
-
s.email = 'technical@rrnpilot.org'
|
6
|
-
s.homepage = 'http://github.com/rrn/acts_as_sourceable'
|
7
|
-
s.summary = 'perform garbage collection on categories that are no longer referenced'
|
8
|
-
s.description = 'Allows the RRN to perform garbage collection on categories that are no longer referenced.'
|
9
|
-
s.authors = ['Nicholas Jakobsen', 'Ryan Wallace']
|
10
|
-
s.require_paths = ["lib"]
|
11
|
-
s.files = `git ls-files`.split("\n")
|
12
|
-
end
|