mr_common 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mr_common/version.rb +1 -1
- data/lib/tasks/mr_common_tasks.rake +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e1538111cda9e8ccd06735902be3b7c9ae49f62b60bdc0255d0d03bae774a18
|
4
|
+
data.tar.gz: a3ad001848e52d06f356908af852e0bd38bf2736840757bbaf89eee3872abd4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f0a2a1385dfa1be6567296dbe45bf59d51b39429cad207876efcd2045052826f7afcb4325b9dcf4223bae098473dc9466a44f48612516ad0487260024fa3e86
|
7
|
+
data.tar.gz: a0d5eb0fa49a08bb4932e45ea397d28daf4eb354e0e9e04bda8c576cb8b0bb2f4eca3433bbdae7cd17a451e5beb073d881eaa38f55b25f47797751b33feb422c
|
data/lib/mr_common/version.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
namespace :mr_common do
|
4
4
|
desc "dump reminders"
|
5
5
|
task dump_reminders: :environment do
|
6
|
-
reminders = Reminder.all.map do |r|
|
6
|
+
reminders = MrCommon::Reminder.all.map do |r|
|
7
7
|
r.attributes
|
8
8
|
end
|
9
9
|
|
@@ -13,18 +13,18 @@ namespace :mr_common do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
yml = reminders.to_yaml
|
16
|
-
file = File.open("
|
16
|
+
file = File.open("mr_common_reminders.yml", "w")
|
17
17
|
file.write(yml)
|
18
18
|
file.close
|
19
19
|
end
|
20
20
|
|
21
21
|
desc "load reminders"
|
22
22
|
task load_reminders: :environment do
|
23
|
-
unless Dir["
|
23
|
+
unless Dir["mr_common_reminders.yml"].any?
|
24
24
|
puts "No reminders to load yet..."
|
25
25
|
exit
|
26
26
|
end
|
27
|
-
reminders = YAML.load(File.read("
|
27
|
+
reminders = YAML.load(File.read("mr_common_reminders.yml"))
|
28
28
|
|
29
29
|
if reminders.any?
|
30
30
|
reminder_fields = %i[
|
@@ -39,7 +39,7 @@ namespace :mr_common do
|
|
39
39
|
]
|
40
40
|
|
41
41
|
reminders.each do |reminder|
|
42
|
-
r = Reminder.find_or_initialize_by(slug: reminder["slug"])
|
42
|
+
r = MrCommon::Reminder.find_or_initialize_by(slug: reminder["slug"])
|
43
43
|
attrs = {}
|
44
44
|
reminder_fields.each { |attr| attrs[attr.to_s] = reminder[attr.to_s] }
|
45
45
|
r.update(attrs)
|