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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/acts_as_archival/version.rb +1 -1
- data/lib/expected_behavior/acts_as_archival.rb +1 -1
- data/test/scope_test.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a53308c0484db785c8114be2103ada7b0844fe2
|
4
|
+
data.tar.gz: c52734e4fa86de33fcdfc162cb40ac21b99bedcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 414a8242172fa875dbe4c2387103e4e48461894271b0dd49487ab8397301261ea1da012435c63fec2056138646df5b0d74a7eb9fb5f429083aa389081989c09e
|
7
|
+
data.tar.gz: be3195952d4aa822ee9cfa73fa80e521d7607728dd8fca65f246177329bde01fb6d6c54b540d49e05d78130c7cdb7daee0579f8849ec9eed67b0b410cc0ee318
|
data/CHANGELOG.md
CHANGED
@@ -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
|
@@ -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
|
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
|
|
data/test/scope_test.rb
CHANGED
@@ -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
|