acts_as_archival 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa2576c02d786c7c0a1606422faa3cdd78a9aaf7
4
- data.tar.gz: 0483e19ed7a866d4a39db48f80fe9d980c362d10
3
+ metadata.gz: 6a53308c0484db785c8114be2103ada7b0844fe2
4
+ data.tar.gz: c52734e4fa86de33fcdfc162cb40ac21b99bedcd
5
5
  SHA512:
6
- metadata.gz: a4d293356b16111c7c5bb9524d98a72fe401830afbbac1ae061d6a9577d69f80e6131533c495ff62ad86cd44a082aa0badb5d34995285bc359d8486d5bdebca9
7
- data.tar.gz: d53ad14039ae0e8675071c5756e780984efafc0a19180f75882c71657ca613a17b949519b37e32fadcf1ea7a5c2cf386701fe8c37d9c7e46acbf4801fde67501
6
+ metadata.gz: 414a8242172fa875dbe4c2387103e4e48461894271b0dd49487ab8397301261ea1da012435c63fec2056138646df5b0d74a7eb9fb5f429083aa389081989c09e
7
+ data.tar.gz: be3195952d4aa822ee9cfa73fa80e521d7607728dd8fca65f246177329bde01fb6d6c54b540d49e05d78130c7cdb7daee0579f8849ec9eed67b0b410cc0ee318
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.1.1 - April 10, 2016
4
+ * Update the way the `::unarchived` scope is generated using `::not` instead of manually building SQL, which should be better for complex queries
5
+
3
6
  ## 1.1.0 - April 10, 2016
4
7
  * **BREAKING CHANGE** obsolete mainline rails 3 and rails 4.0.x support because: they are EOL'ed for > 1y
5
8
  * add rails 4.2 automated tests
@@ -1,3 +1,3 @@
1
1
  module ActsAsArchival
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -18,7 +18,7 @@ module ExpectedBehavior
18
18
  before_validation :raise_if_not_archival
19
19
  validate :readonly_when_archived if options[:readonly_when_archived]
20
20
 
21
- scope :archived, lambda { where %Q{#{self.table_name}.archived_at IS NOT NULL AND #{self.table_name}.archive_number IS NOT NULL} }
21
+ scope :archived, lambda { where.not(:archived_at => nil, :archive_number => nil) }
22
22
  scope :unarchived, lambda { where(:archived_at => nil, :archive_number => nil) }
23
23
  scope :archived_from_archive_number, lambda { |head_archive_number| where(['archived_at IS NOT NULL AND archive_number = ?', head_archive_number]) }
24
24
 
@@ -55,7 +55,7 @@ class ScopeTest < ActiveSupport::TestCase
55
55
  else
56
56
  " "
57
57
  end
58
- archived_sql = %Q{SELECT "legacy".* FROM "legacy"#{spaces}WHERE (legacy.archived_at IS NOT NULL AND legacy.archive_number IS NOT NULL)}
58
+ archived_sql = %Q{SELECT "legacy".* FROM "legacy"#{spaces}WHERE ("legacy"."archived_at" IS NOT NULL) AND ("legacy"."archive_number" IS NOT NULL)}
59
59
  unarchived_sql = %Q{SELECT "legacy".* FROM "legacy"#{spaces}WHERE "legacy"."archived_at" IS NULL AND "legacy"."archive_number" IS NULL}
60
60
  assert_equal archived_sql, ArchivalTableName.archived.to_sql
61
61
  assert_equal unarchived_sql, ArchivalTableName.unarchived.to_sql
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_archival
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Meador