cats_core 1.1.4 → 1.1.5
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1edf27e2257545cf71d59da4348838a7d413911a3977e505e9ea38788bbf6bc0
|
4
|
+
data.tar.gz: 7b11450abaf98eed4cde168465e0f778be42026895d52883760bbe5cb0b571ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26de9f25dc8533a8ad33089cedacf51feff5b7ecfba6c08bfa55d811e7672cd4892955bccdd853a7281ec677a31478c9e3f8ecc2e421c79cbdeb34559b15c7d2
|
7
|
+
data.tar.gz: 26c4b80b13de8a60a02545382205877c8a252beebf2943ca990860a5bd32652d1152b865a90940dc0a55eebfca1c3bde974bfb6dfa07addaf174c59a5e74674a
|
@@ -5,6 +5,16 @@ module Cats
|
|
5
5
|
|
6
6
|
validates :reference_no, presence: true, uniqueness: true
|
7
7
|
validates :gift_date, presence: true
|
8
|
+
|
9
|
+
after_create :update_donation
|
10
|
+
|
11
|
+
def update_donation
|
12
|
+
donation = self.donation
|
13
|
+
return if donation.active
|
14
|
+
|
15
|
+
donation.active = true
|
16
|
+
donation.save!
|
17
|
+
end
|
8
18
|
end
|
9
19
|
end
|
10
20
|
end
|
@@ -8,6 +8,16 @@ module Cats
|
|
8
8
|
validates :reference_no, uniqueness: true
|
9
9
|
|
10
10
|
delegate(:name, to: :commodity_category, prefix: true)
|
11
|
+
|
12
|
+
after_create :update_donation
|
13
|
+
|
14
|
+
def update_donation
|
15
|
+
donation = self.donation
|
16
|
+
return if donation.active
|
17
|
+
|
18
|
+
donation.active = true
|
19
|
+
donation.save!
|
20
|
+
end
|
11
21
|
end
|
12
22
|
end
|
13
23
|
end
|
data/lib/cats/core/version.rb
CHANGED