ish_manager 0.1.8.23 → 0.1.8.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a38a20e38b5e29c8e5f4258bd58942a922a0b369
|
4
|
+
data.tar.gz: bab59f30485aee9d86b95ef9c02627e1be30f985
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 008e4acf1a5b152bf3c947f08877224205ece3b4c356ddda3763094ce6ecb6fcb7480345e045f2dda5dc582d54a9e7d5c22814c574530d78636f527cf5f42264
|
7
|
+
data.tar.gz: 604ca5f41e82ef3327774aa48aeaa613cbf279c7377b2f618d66ada64bdf544cf25ced91ae815b67c328f62af91b9df9051e48f8a0b6d2341fb19e8a786502ae
|
@@ -14,17 +14,19 @@ class IshManager::CitiesController < IshManager::ApplicationController
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def new
|
17
|
-
authorize! :new, ManagerCity.new
|
18
17
|
@city = City.new
|
18
|
+
authorize! :new, City
|
19
|
+
|
19
20
|
@photo = Photo.new
|
20
21
|
end
|
21
22
|
|
22
23
|
def create
|
23
|
-
authorize! :create, ManagerCity.new
|
24
24
|
@city = City.new params[:city].permit!
|
25
|
+
authorize! :create, @city
|
26
|
+
|
25
27
|
if @city.save
|
26
28
|
flash[:notice] = 'Success'
|
27
|
-
redirect_to
|
29
|
+
redirect_to cities_path
|
28
30
|
else
|
29
31
|
flash[:error] = 'No Luck'
|
30
32
|
render :action => :new
|
@@ -36,12 +38,12 @@ class IshManager::CitiesController < IshManager::ApplicationController
|
|
36
38
|
end
|
37
39
|
|
38
40
|
def update
|
39
|
-
authorize! :update, ManagerCity.new
|
40
41
|
@city = City.find( params[:id] )
|
42
|
+
authorize! :update, @city
|
41
43
|
@city.update_attributes params[:city].permit!
|
42
44
|
if @city.save
|
43
45
|
flash[:notice] = 'Success'
|
44
|
-
redirect_to
|
46
|
+
redirect_to edit_city_path @city.id
|
45
47
|
else
|
46
48
|
flash[:error] = 'No Luck. ' + @city.errors.inspect
|
47
49
|
@newsitems = @city.newsitems.all.page( params[:newsitems_page] )
|
@@ -52,7 +54,7 @@ class IshManager::CitiesController < IshManager::ApplicationController
|
|
52
54
|
end
|
53
55
|
|
54
56
|
def change_profile_pic
|
55
|
-
authorize! :change_profile_pic,
|
57
|
+
authorize! :change_profile_pic, City
|
56
58
|
@city = City.find params[:id]
|
57
59
|
@photo = Photo.new params[:photo]
|
58
60
|
@photo.user = @current_user
|
@@ -64,7 +66,7 @@ class IshManager::CitiesController < IshManager::ApplicationController
|
|
64
66
|
else
|
65
67
|
flash[:error] = "No Luck. #{@photo.errors.inspect} #{@city.errors.inspect}"
|
66
68
|
end
|
67
|
-
redirect_to
|
69
|
+
redirect_to cities_path
|
68
70
|
end
|
69
71
|
|
70
72
|
private
|