acts_as_sourceable 2.1.5 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- OTM4YjRkMGUzYTZhNjE3NTJkYjk4ZmRjOTRlNTg1Zjg1OTg5YmQ0Yw==
5
- data.tar.gz: !binary |-
6
- NDRiMjZjMDczZGI1YTVhMmY1MWVmYzc2N2I4YjRhNGZlNjdmNmUxNQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ODc4ZTMwMWI2MjUwNjYxOTRmMGQ1NjgxZDRiOTQ1MzEwZmYxYTJhYzI1OThj
10
- ZmJkMjhhODM4OTY1MThiYmU5ZGE2YjVlYTE0NzM2ZmRiZGNmMDBjNTJiYjIw
11
- YThlYzFiMDJjM2QxYWYzZTk3ZjViOThlYTk1OWZhOTgyYTgwYTc=
12
- data.tar.gz: !binary |-
13
- MTA1M2M1ZGYyNzUzYTY0OGNjYTI4MjFmZTM1ZWUzYzI2OWJjM2VhNjllNzRk
14
- ZGYxMGYxZDZkODZhNTc2M2IwNjJjMTA1Y2RiZTdlYWUwMWI5MzU5NzZlN2Rh
15
- NGYzMDBkNzBmYWNmMTJjYmE5YjhiZWViMmQ5MDU0ZTYyOTQzNTA=
2
+ SHA1:
3
+ metadata.gz: cbea8083a7e55b7564806fdb3b45949ba6f3ecf0
4
+ data.tar.gz: 769945cd32379edd5fb48cde928313261dd55fe8
5
+ SHA512:
6
+ metadata.gz: e0fff5cc8519cda5dbd5b9a1735edfc27b223a344680a3374538847988043561bfe59520f055f9f4a390926f027b000f03ae0d93e516661b55f67e8d4775b20a
7
+ data.tar.gz: 4be367a71ea15eb1ec0a1636ce2ff04baf1c1384bdce5645613c63530b482a31c5d22c65c61039935ab08873a3c878496598c31fc2f3e83b73324711c2f1fa41
@@ -74,7 +74,8 @@ module ActsAsSourceable
74
74
  alias_method :add_source, :add_sources
75
75
 
76
76
  def unsource
77
- scoping { @klass.update_all("#{acts_as_sourceable_options[:cache_column]} = false", @klass.acts_as_sourceable_options[:cache_column] => true) } if @klass.acts_as_sourceable_options[:cache_column]
77
+ # OPTIMIZATION: it's faster to only set the cache column to false if it is true instead of setting all to false indiscriminately
78
+ scoping { @klass.where(@klass.acts_as_sourceable_options[:cache_column] => true).update_all("#{acts_as_sourceable_options[:cache_column]} = false") } if @klass.acts_as_sourceable_options[:cache_column]
78
79
  scoping { ActsAsSourceable::RegistryEntry.where("sourceable_type = ? AND sourceable_id IN (#{@klass.select("#{@klass.table_name}.id").to_sql})", @klass.name).delete_all }
79
80
  end
80
81
  end
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.5
4
+ version: 2.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Jakobsen
@@ -31,17 +31,17 @@ require_paths:
31
31
  - lib
32
32
  required_ruby_version: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - ! '>='
34
+ - - '>='
35
35
  - !ruby/object:Gem::Version
36
36
  version: '0'
37
37
  required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ! '>='
39
+ - - '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  requirements: []
43
43
  rubyforge_project:
44
- rubygems_version: 2.0.0
44
+ rubygems_version: 2.0.5
45
45
  signing_key:
46
46
  specification_version: 4
47
47
  summary: perform garbage collection on categories that are no longer referenced