deleted_at 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deleted_at/active_record/base.rb +10 -0
- data/lib/deleted_at/version.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: f0dbd1191992d563691e2cb03bfacfafcb308b12
|
4
|
+
data.tar.gz: e1b31685bc435d6cf3e9d5ce60266a8a03b620c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1795c5da2dd398338630cfd73e73c48d87e492f48b578ba2bb69b106f827f89cb05be7a5fb8011abd9648a0c95885666809dc6a404f1180e32a54f07068872b
|
7
|
+
data.tar.gz: 4df3ac496604622b1058784f4da4381d7ba87cf411145a6171126a74f72f99091c49bafe25305bc6785e17a7db2e706b6421d0fbada7ffc1892be7becdf53850
|
@@ -16,11 +16,21 @@ module DeletedAt
|
|
16
16
|
false
|
17
17
|
end
|
18
18
|
end
|
19
|
+
alias_method_chain :create, :deleted_at
|
19
20
|
end
|
21
|
+
|
20
22
|
end
|
21
23
|
|
22
24
|
module ClassMethods
|
23
25
|
|
26
|
+
def create_with_deleted_at(attributes = nil, &block)
|
27
|
+
if archive_with_deleted_at?
|
28
|
+
const_get(:All).create_without_deleted_at(attributes, &block)
|
29
|
+
else
|
30
|
+
create_without_deleted_at
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
24
34
|
def with_deleted_at(options={})
|
25
35
|
|
26
36
|
parse_options(options)
|
data/lib/deleted_at/version.rb
CHANGED