my_plugin 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/my_plugin/version.rb +1 -1
- data/lib/tasks/my_plugin.rake +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTg3NTFiYjYzNmMzYzM5MjkwOWQxYTU0NmI2YjNiZjQyZGMwOTY0MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODZlZTEyZWNmNTAxYWVhMDI2YjRmMWMyNWU3NDc3MzdlMDk1MGE4OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGQzZTZiMjc5ODM2ZWYwNDFlZWU1YWJlODg0MjdmNGU2YzZiZjg0Nzc2MmZh
|
10
|
+
MTk0NTBiZjZkNjBiNDVlODE3OWQ3NWMxOGJmM2UxNjU4MjAxZDU2NjM2ZjUz
|
11
|
+
ZDQzOTI3Zjc2ZDljMjQyNGE1MjQzNzU5NGFhMWJlZjEwNGIyOTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDQxNjAzNTY4ZjlkMzFmNjg5OWFiMTJmMDUxODRkNDY5Nzk1Mzk5NTcyZWVm
|
14
|
+
ODAyNjY2NzgzY2I0ZmQ2MGVjNGQwMjc1YWZiZWEzYWZhYTA0MmI2MGMxNWVl
|
15
|
+
MTE4OTg4ZTRkNjg2ZDRlNzY2ZWRlNDg4OWZiNDljMTY3YmYxNzU=
|
data/lib/my_plugin/version.rb
CHANGED
data/lib/tasks/my_plugin.rake
CHANGED
@@ -10,6 +10,7 @@ namespace :db do
|
|
10
10
|
|
11
11
|
found_by_id = found_by_id.to_i
|
12
12
|
model_class = model_class.constantize
|
13
|
+
field = field.to_sym
|
13
14
|
|
14
15
|
puts "#{pick(model_class).username}"
|
15
16
|
puts "#{set(model_class, field, found_by_id, key_pair)}"
|
@@ -21,7 +22,7 @@ namespace :db do
|
|
21
22
|
def set(model_class, field, found_by_id, key_pair)
|
22
23
|
puts "putting value in model attribute"
|
23
24
|
obj = model_class.find(found_by_id)
|
24
|
-
obj.send(field
|
25
|
+
obj.send(field+'=', Hash[*key_pair.split(',')])
|
25
26
|
obj.save
|
26
27
|
end
|
27
28
|
|
@@ -30,7 +31,7 @@ namespace :db do
|
|
30
31
|
def get(model_class, field, found_by_id, key_pair)
|
31
32
|
puts "getting value in model attribute"
|
32
33
|
obj = model_class.find(found_by_id)
|
33
|
-
obj.send(field
|
34
|
+
obj.send(field)
|
34
35
|
end
|
35
36
|
|
36
37
|
desc "Pick model attribute"
|