pattana 0.1.10 → 0.1.11
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 +4 -4
- data/app/controllers/pattana/api/v1/cities_controller.rb +2 -0
- data/app/controllers/pattana/api/v1/countries_controller.rb +2 -1
- data/app/controllers/pattana/api/v1/docs_controller.rb +4 -4
- data/app/controllers/pattana/api/v1/regions_controller.rb +1 -0
- data/app/models/city.rb +1 -0
- data/app/models/country.rb +1 -0
- data/app/models/region.rb +1 -0
- data/app/views/pattana/api/v1/docs/cities_in_a_country/_pos_case_3.html.erb +64 -0
- data/app/views/pattana/api/v1/docs/cities_in_a_country/_pos_case_4.html.erb +64 -0
- data/app/views/pattana/api/v1/docs/cities_in_a_region/_pos_case_2.html.erb +1 -1
- data/app/views/pattana/api/v1/docs/cities_in_a_region/_pos_case_3.html.erb +64 -0
- data/app/views/pattana/api/v1/docs/cities_in_a_region/_pos_case_4.html.erb +64 -0
- data/app/views/pattana/api/v1/docs/countries/_pos_case_3.html.erb +51 -0
- data/app/views/pattana/api/v1/docs/countries/_pos_case_4.html.erb +51 -0
- data/app/views/pattana/api/v1/docs/regions/_pos_case_2.html.erb +1 -1
- data/app/views/pattana/api/v1/docs/regions/_pos_case_3.html.erb +66 -0
- data/app/views/pattana/api/v1/docs/regions/_pos_case_4.html.erb +66 -0
- data/app/views/pattana/dashboard/index.html.erb +10 -1
- data/lib/pattana/version.rb +1 -1
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d191b186ccf58e2094dad4b6c5c3087596acd7b
|
4
|
+
data.tar.gz: ca76b41cafef4b27c4dfb5bf73ef268819d46ed0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a783ee301a8750c1b42981245cb5ce6c34cc9af45223400ddef74da56b02496603602be5ff3e7777642988a53476a1acb3d9c6e04b72f6d7dbdf740acfe29e8
|
7
|
+
data.tar.gz: 6332ae96eca914d63055208eec7d56a828d7ced81ddb5288ca8aa99759eb85b8d1cf7a0c827a84686ca8dc1fab9eac1e8ae4c9460d4f3e4f011e90ade9748a0f
|
@@ -9,6 +9,7 @@ module Pattana
|
|
9
9
|
if @country
|
10
10
|
@relation = @country.cities.includes(:region, :country).where("cities.show_in_api is true").order("cities.name ASC")
|
11
11
|
@relation = @relation.search(params[:q]) if params[:q]
|
12
|
+
@relation = @relation.operational if params[:operational] && ["y","t","yes","true",1].include?(params[:operational].downcase)
|
12
13
|
@cities = @relation.all
|
13
14
|
@data = ActiveModelSerializers::SerializableResource.new(@cities, each_serializer: CityPreviewSerializer)
|
14
15
|
@success = true
|
@@ -29,6 +30,7 @@ module Pattana
|
|
29
30
|
if @region
|
30
31
|
@relation = @region.cities.includes(:region, :country).where("cities.show_in_api is true").order("cities.name ASC")
|
31
32
|
@relation = @relation.search(params[:q]) if params[:q]
|
33
|
+
@relation = @relation.operational if params[:operational] && ["y","t","yes","true",1].include?(params[:operational].downcase)
|
32
34
|
@cities = @relation.all
|
33
35
|
@data = ActiveModelSerializers::SerializableResource.new(@cities, each_serializer: CityPreviewSerializer)
|
34
36
|
@success = true
|
@@ -5,8 +5,9 @@ module Pattana
|
|
5
5
|
|
6
6
|
def index
|
7
7
|
proc_code = Proc.new do
|
8
|
-
@relation = Country.
|
8
|
+
@relation = Country.show_in_api.order("countries.name ASC")
|
9
9
|
@relation = @relation.search(params[:q]) if params[:q]
|
10
|
+
@relation = @relation.operational if params[:operational] && ["y","t","yes","true",1].include?(params[:operational].downcase)
|
10
11
|
@countries = @relation.all
|
11
12
|
@data = ActiveModelSerializers::SerializableResource.new(@countries, each_serializer: CountryPreviewSerializer)
|
12
13
|
@success = true
|
@@ -21,7 +21,7 @@ module Pattana
|
|
21
21
|
}
|
22
22
|
|
23
23
|
@example_path = "pattana/api/v1/docs/"
|
24
|
-
@examples = ["pos_case_1", "pos_case_2"]
|
24
|
+
@examples = ["pos_case_1", "pos_case_2", "pos_case_3", "pos_case_4"]
|
25
25
|
|
26
26
|
set_nav("docs/countries")
|
27
27
|
|
@@ -49,7 +49,7 @@ module Pattana
|
|
49
49
|
}
|
50
50
|
|
51
51
|
@example_path = "pattana/api/v1/docs/"
|
52
|
-
@examples = ["pos_case_1", "pos_case_2", "neg_case_1"]
|
52
|
+
@examples = ["pos_case_1", "pos_case_2", "pos_case_3", "pos_case_4", "neg_case_1"]
|
53
53
|
|
54
54
|
set_nav("docs/regions")
|
55
55
|
|
@@ -78,7 +78,7 @@ module Pattana
|
|
78
78
|
}
|
79
79
|
|
80
80
|
@example_path = "pattana/api/v1/docs/"
|
81
|
-
@examples = ["pos_case_1", "pos_case_2", "neg_case_1"]
|
81
|
+
@examples = ["pos_case_1", "pos_case_2", "pos_case_3", "pos_case_4", "neg_case_1"]
|
82
82
|
|
83
83
|
set_nav("docs/cities_in_a_country")
|
84
84
|
|
@@ -107,7 +107,7 @@ module Pattana
|
|
107
107
|
}
|
108
108
|
|
109
109
|
@example_path = "pattana/api/v1/docs/"
|
110
|
-
@examples = ["pos_case_1", "pos_case_2", "neg_case_1"]
|
110
|
+
@examples = ["pos_case_1", "pos_case_2", "pos_case_3", "pos_case_4", "neg_case_1"]
|
111
111
|
|
112
112
|
set_nav("docs/cities_in_a_region")
|
113
113
|
|
@@ -9,6 +9,7 @@ module Pattana
|
|
9
9
|
if @country
|
10
10
|
@relation = @country.regions.includes(:country).where("regions.show_in_api is true").order("regions.name ASC")
|
11
11
|
@relation = @relation.search(params[:q]) if params[:q]
|
12
|
+
@relation = @relation.operational if params[:operational] && ["y","t","yes","true",1].include?(params[:operational].downcase)
|
12
13
|
@regions = @relation.all
|
13
14
|
@data = ActiveModelSerializers::SerializableResource.new(@regions, each_serializer: RegionPreviewSerializer)
|
14
15
|
@success = true
|
data/app/models/city.rb
CHANGED
data/app/models/country.rb
CHANGED
data/app/models/region.rb
CHANGED
@@ -34,6 +34,7 @@ class Region < Pattana::ApplicationRecord
|
|
34
34
|
scope :search, lambda {|query| joins("INNER JOIN countries co on co.id = regions.country_id").where("LOWER(regions.name) LIKE LOWER('%#{query}%') || LOWER(regions.iso_code) LIKE LOWER('%#{query}%') || LOWER(co.name) LIKE LOWER('%#{query}%')")}
|
35
35
|
|
36
36
|
scope :show_in_api, -> { where(show_in_api: true) }
|
37
|
+
scope :operational, -> { where(operational: true) }
|
37
38
|
|
38
39
|
# Import Methods
|
39
40
|
|
@@ -0,0 +1,64 @@
|
|
1
|
+
<%
|
2
|
+
|
3
|
+
api_title = "Positive Case - 3 - should return cities in a particular country which are operational"
|
4
|
+
|
5
|
+
api_input = <<-eos
|
6
|
+
Example:
|
7
|
+
|
8
|
+
GET #{request.base_url}/api/v1/countries/235?operational=true
|
9
|
+
This will return only the operational cities in the country with id 235
|
10
|
+
eos
|
11
|
+
|
12
|
+
api_output = <<-eos
|
13
|
+
{
|
14
|
+
"success": true,
|
15
|
+
"data": [
|
16
|
+
{
|
17
|
+
"id": 21,
|
18
|
+
"name": "Abu Dhabi",
|
19
|
+
"priority": 1000,
|
20
|
+
"country": {
|
21
|
+
"id": 235,
|
22
|
+
"name": "United Arab Emirates",
|
23
|
+
"iso_name": "UNITED ARAB EMIRATES",
|
24
|
+
"dialing_prefix": "971",
|
25
|
+
"priority": 1000
|
26
|
+
},
|
27
|
+
"region": {
|
28
|
+
"id": 14,
|
29
|
+
"name": "Abu Dhabi",
|
30
|
+
"priority": 1000
|
31
|
+
}
|
32
|
+
},
|
33
|
+
.
|
34
|
+
.
|
35
|
+
.
|
36
|
+
{
|
37
|
+
"id": 8,
|
38
|
+
"name": "Umm al Qaywayn",
|
39
|
+
"priority": 1000,
|
40
|
+
"country": {
|
41
|
+
"id": 235,
|
42
|
+
"name": "United Arab Emirates",
|
43
|
+
"iso_name": "UNITED ARAB EMIRATES",
|
44
|
+
"dialing_prefix": "971",
|
45
|
+
"priority": 1000
|
46
|
+
},
|
47
|
+
"region": {
|
48
|
+
"id": 8,
|
49
|
+
"name": "Umm Al Quwain",
|
50
|
+
"priority": 1000
|
51
|
+
}
|
52
|
+
}]
|
53
|
+
}
|
54
|
+
eos
|
55
|
+
|
56
|
+
%>
|
57
|
+
|
58
|
+
<%= render partial: "kuppayam/api/docs/example", locals: {
|
59
|
+
negative_case: false,
|
60
|
+
example_id: "pos_case_3",
|
61
|
+
api_title: api_title,
|
62
|
+
api_input: api_input,
|
63
|
+
api_output: api_output
|
64
|
+
} %>
|
@@ -0,0 +1,64 @@
|
|
1
|
+
<%
|
2
|
+
|
3
|
+
api_title = "Positive Case - 4 - should search for cities in a particular country which are operational"
|
4
|
+
|
5
|
+
api_input = <<-eos
|
6
|
+
Example:
|
7
|
+
|
8
|
+
GET #{request.base_url}/api/v1/countries/235?operational=true&cy=ode
|
9
|
+
This will search for operational cities in the country with id 235 for the keyword 'ode' and will return matching results
|
10
|
+
eos
|
11
|
+
|
12
|
+
api_output = <<-eos
|
13
|
+
{
|
14
|
+
"success": true,
|
15
|
+
"data": [
|
16
|
+
{
|
17
|
+
"id": 21,
|
18
|
+
"name": "Abu Dhabi",
|
19
|
+
"priority": 1000,
|
20
|
+
"country": {
|
21
|
+
"id": 235,
|
22
|
+
"name": "United Arab Emirates",
|
23
|
+
"iso_name": "UNITED ARAB EMIRATES",
|
24
|
+
"dialing_prefix": "971",
|
25
|
+
"priority": 1000
|
26
|
+
},
|
27
|
+
"region": {
|
28
|
+
"id": 14,
|
29
|
+
"name": "Abu Dhabi",
|
30
|
+
"priority": 1000
|
31
|
+
}
|
32
|
+
},
|
33
|
+
.
|
34
|
+
.
|
35
|
+
.
|
36
|
+
{
|
37
|
+
"id": 8,
|
38
|
+
"name": "Umm al Qaywayn",
|
39
|
+
"priority": 1000,
|
40
|
+
"country": {
|
41
|
+
"id": 235,
|
42
|
+
"name": "United Arab Emirates",
|
43
|
+
"iso_name": "UNITED ARAB EMIRATES",
|
44
|
+
"dialing_prefix": "971",
|
45
|
+
"priority": 1000
|
46
|
+
},
|
47
|
+
"region": {
|
48
|
+
"id": 8,
|
49
|
+
"name": "Umm Al Quwain",
|
50
|
+
"priority": 1000
|
51
|
+
}
|
52
|
+
}]
|
53
|
+
}
|
54
|
+
eos
|
55
|
+
|
56
|
+
%>
|
57
|
+
|
58
|
+
<%= render partial: "kuppayam/api/docs/example", locals: {
|
59
|
+
negative_case: false,
|
60
|
+
example_id: "pos_case_4",
|
61
|
+
api_title: api_title,
|
62
|
+
api_input: api_input,
|
63
|
+
api_output: api_output
|
64
|
+
} %>
|
@@ -0,0 +1,64 @@
|
|
1
|
+
<%
|
2
|
+
|
3
|
+
api_title = "Positive Case - 3 - should return operational cities in a region"
|
4
|
+
|
5
|
+
api_input = <<-eos
|
6
|
+
Example:
|
7
|
+
|
8
|
+
GET #{request.base_url}/api/v1/regions/1403?operational=true
|
9
|
+
This will return only the operational cities in the region with id 1403
|
10
|
+
eos
|
11
|
+
|
12
|
+
api_output = <<-eos
|
13
|
+
{
|
14
|
+
"success": true,
|
15
|
+
"data": [
|
16
|
+
{
|
17
|
+
"id": 21,
|
18
|
+
"name": "Abu Dhabi",
|
19
|
+
"priority": 1000,
|
20
|
+
"country": {
|
21
|
+
"id": 235,
|
22
|
+
"name": "United Arab Emirates",
|
23
|
+
"iso_name": "UNITED ARAB EMIRATES",
|
24
|
+
"dialing_prefix": "971",
|
25
|
+
"priority": 1000
|
26
|
+
},
|
27
|
+
"region": {
|
28
|
+
"id": 14,
|
29
|
+
"name": "Abu Dhabi",
|
30
|
+
"priority": 1000
|
31
|
+
}
|
32
|
+
},
|
33
|
+
.
|
34
|
+
.
|
35
|
+
.
|
36
|
+
{
|
37
|
+
"id": 8,
|
38
|
+
"name": "Umm al Qaywayn",
|
39
|
+
"priority": 1000,
|
40
|
+
"country": {
|
41
|
+
"id": 235,
|
42
|
+
"name": "United Arab Emirates",
|
43
|
+
"iso_name": "UNITED ARAB EMIRATES",
|
44
|
+
"dialing_prefix": "971",
|
45
|
+
"priority": 1000
|
46
|
+
},
|
47
|
+
"region": {
|
48
|
+
"id": 8,
|
49
|
+
"name": "Umm Al Quwain",
|
50
|
+
"priority": 1000
|
51
|
+
}
|
52
|
+
}]
|
53
|
+
}
|
54
|
+
eos
|
55
|
+
|
56
|
+
%>
|
57
|
+
|
58
|
+
<%= render partial: "kuppayam/api/docs/example", locals: {
|
59
|
+
negative_case: false,
|
60
|
+
example_id: "pos_case_3",
|
61
|
+
api_title: api_title,
|
62
|
+
api_input: api_input,
|
63
|
+
api_output: api_output
|
64
|
+
} %>
|
@@ -0,0 +1,64 @@
|
|
1
|
+
<%
|
2
|
+
|
3
|
+
api_title = "Positive Case - 4 - should search cities in a region"
|
4
|
+
|
5
|
+
api_input = <<-eos
|
6
|
+
Example:
|
7
|
+
|
8
|
+
GET #{request.base_url}/api/v1/regions/1403?operational=true&q=ode
|
9
|
+
This will search for operational cities in the region with id 1403 for the keyword 'ode' and will return matching results
|
10
|
+
eos
|
11
|
+
|
12
|
+
api_output = <<-eos
|
13
|
+
{
|
14
|
+
"success": true,
|
15
|
+
"data": [
|
16
|
+
{
|
17
|
+
"id": 21,
|
18
|
+
"name": "Abu Dhabi",
|
19
|
+
"priority": 1000,
|
20
|
+
"country": {
|
21
|
+
"id": 235,
|
22
|
+
"name": "United Arab Emirates",
|
23
|
+
"iso_name": "UNITED ARAB EMIRATES",
|
24
|
+
"dialing_prefix": "971",
|
25
|
+
"priority": 1000
|
26
|
+
},
|
27
|
+
"region": {
|
28
|
+
"id": 14,
|
29
|
+
"name": "Abu Dhabi",
|
30
|
+
"priority": 1000
|
31
|
+
}
|
32
|
+
},
|
33
|
+
.
|
34
|
+
.
|
35
|
+
.
|
36
|
+
{
|
37
|
+
"id": 8,
|
38
|
+
"name": "Umm al Qaywayn",
|
39
|
+
"priority": 1000,
|
40
|
+
"country": {
|
41
|
+
"id": 235,
|
42
|
+
"name": "United Arab Emirates",
|
43
|
+
"iso_name": "UNITED ARAB EMIRATES",
|
44
|
+
"dialing_prefix": "971",
|
45
|
+
"priority": 1000
|
46
|
+
},
|
47
|
+
"region": {
|
48
|
+
"id": 8,
|
49
|
+
"name": "Umm Al Quwain",
|
50
|
+
"priority": 1000
|
51
|
+
}
|
52
|
+
}]
|
53
|
+
}
|
54
|
+
eos
|
55
|
+
|
56
|
+
%>
|
57
|
+
|
58
|
+
<%= render partial: "kuppayam/api/docs/example", locals: {
|
59
|
+
negative_case: false,
|
60
|
+
example_id: "pos_case_4",
|
61
|
+
api_title: api_title,
|
62
|
+
api_input: api_input,
|
63
|
+
api_output: api_output
|
64
|
+
} %>
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<%
|
2
|
+
|
3
|
+
api_title = "Positive Case - 3 - should return operational countries"
|
4
|
+
|
5
|
+
api_input = <<-eos
|
6
|
+
Example:
|
7
|
+
|
8
|
+
GET #{request.base_url}/api/v1/countries?operational=true
|
9
|
+
This will return only the operational countries
|
10
|
+
eos
|
11
|
+
|
12
|
+
api_output = <<-eos
|
13
|
+
{
|
14
|
+
"success": true,
|
15
|
+
"data": [
|
16
|
+
{
|
17
|
+
"id": 100,
|
18
|
+
"name": "India",
|
19
|
+
"iso_name": "INDIA",
|
20
|
+
"dialing_prefix": "91",
|
21
|
+
"priority": 1000
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"id": 2,
|
25
|
+
"name": "Albania",
|
26
|
+
"iso_name": "ALBANIA",
|
27
|
+
"dialing_prefix": "355",
|
28
|
+
"priority": 1000
|
29
|
+
},
|
30
|
+
.
|
31
|
+
.
|
32
|
+
.
|
33
|
+
{
|
34
|
+
"id": 246,
|
35
|
+
"name": "Zimbabwe",
|
36
|
+
"iso_name": "ZIMBABWE",
|
37
|
+
"dialing_prefix": "263",
|
38
|
+
"priority": 1000
|
39
|
+
}]
|
40
|
+
}
|
41
|
+
eos
|
42
|
+
|
43
|
+
%>
|
44
|
+
|
45
|
+
<%= render partial: "kuppayam/api/docs/example", locals: {
|
46
|
+
negative_case: false,
|
47
|
+
example_id: "pos_case_3",
|
48
|
+
api_title: api_title,
|
49
|
+
api_input: api_input,
|
50
|
+
api_output: api_output
|
51
|
+
} %>
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<%
|
2
|
+
|
3
|
+
api_title = "Positive Case - 4 - should search operational countries"
|
4
|
+
|
5
|
+
api_input = <<-eos
|
6
|
+
Example:
|
7
|
+
|
8
|
+
GET #{request.base_url}/api/v1/countries?operationa=true&q=Ind
|
9
|
+
This will search for operational countries for the keyword 'Ind' and will return matching results
|
10
|
+
eos
|
11
|
+
|
12
|
+
api_output = <<-eos
|
13
|
+
{
|
14
|
+
"success": true,
|
15
|
+
"data": [
|
16
|
+
{
|
17
|
+
"id": 100,
|
18
|
+
"name": "India",
|
19
|
+
"iso_name": "INDIA",
|
20
|
+
"dialing_prefix": "91",
|
21
|
+
"priority": 1000
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"id": 2,
|
25
|
+
"name": "Albania",
|
26
|
+
"iso_name": "ALBANIA",
|
27
|
+
"dialing_prefix": "355",
|
28
|
+
"priority": 1000
|
29
|
+
},
|
30
|
+
.
|
31
|
+
.
|
32
|
+
.
|
33
|
+
{
|
34
|
+
"id": 246,
|
35
|
+
"name": "Zimbabwe",
|
36
|
+
"iso_name": "ZIMBABWE",
|
37
|
+
"dialing_prefix": "263",
|
38
|
+
"priority": 1000
|
39
|
+
}]
|
40
|
+
}
|
41
|
+
eos
|
42
|
+
|
43
|
+
%>
|
44
|
+
|
45
|
+
<%= render partial: "kuppayam/api/docs/example", locals: {
|
46
|
+
negative_case: false,
|
47
|
+
example_id: "pos_case_2",
|
48
|
+
api_title: api_title,
|
49
|
+
api_input: api_input,
|
50
|
+
api_output: api_output
|
51
|
+
} %>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<%
|
2
|
+
|
3
|
+
api_title = "Positive Case - 3 - should return search regions in a country"
|
4
|
+
|
5
|
+
api_input = <<-eos
|
6
|
+
Example:
|
7
|
+
|
8
|
+
GET #{request.base_url}/api/v1/235/regions?operational=true
|
9
|
+
This will return only the operational regions
|
10
|
+
eos
|
11
|
+
|
12
|
+
api_output = <<-eos
|
13
|
+
{
|
14
|
+
"success": true,
|
15
|
+
"data": [
|
16
|
+
{
|
17
|
+
"id": 1329,
|
18
|
+
"name": "Andaman and Nicobar Islands",
|
19
|
+
"priority": 1000,
|
20
|
+
"country": {
|
21
|
+
"id": 100,
|
22
|
+
"name": "India",
|
23
|
+
"iso_name": "INDIA",
|
24
|
+
"dialing_prefix": "91",
|
25
|
+
"priority": 1000
|
26
|
+
}
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"id": 1328,
|
30
|
+
"name": "Andhra Pradesh",
|
31
|
+
"priority": 1000,
|
32
|
+
"country": {
|
33
|
+
"id": 100,
|
34
|
+
"name": "India",
|
35
|
+
"iso_name": "INDIA",
|
36
|
+
"dialing_prefix": "91",
|
37
|
+
"priority": 1000
|
38
|
+
}
|
39
|
+
},
|
40
|
+
.
|
41
|
+
.
|
42
|
+
.
|
43
|
+
{
|
44
|
+
"id": 1332,
|
45
|
+
"name": "Uttaranchal",
|
46
|
+
"priority": 1000,
|
47
|
+
"country": {
|
48
|
+
"id": 100,
|
49
|
+
"name": "India",
|
50
|
+
"iso_name": "INDIA",
|
51
|
+
"dialing_prefix": "91",
|
52
|
+
"priority": 1000
|
53
|
+
}
|
54
|
+
}]
|
55
|
+
}
|
56
|
+
eos
|
57
|
+
|
58
|
+
%>
|
59
|
+
|
60
|
+
<%= render partial: "kuppayam/api/docs/example", locals: {
|
61
|
+
negative_case: false,
|
62
|
+
example_id: "pos_case_3",
|
63
|
+
api_title: api_title,
|
64
|
+
api_input: api_input,
|
65
|
+
api_output: api_output
|
66
|
+
} %>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<%
|
2
|
+
|
3
|
+
api_title = "Positive Case - 4 - should return search operational regions in a country"
|
4
|
+
|
5
|
+
api_input = <<-eos
|
6
|
+
Example:
|
7
|
+
|
8
|
+
GET #{request.base_url}/api/v1/235/regions?operational=true&q=Dub
|
9
|
+
This will search for operational regions in the country with id 235 for the keyword 'Dub' and will return matching results
|
10
|
+
eos
|
11
|
+
|
12
|
+
api_output = <<-eos
|
13
|
+
{
|
14
|
+
"success": true,
|
15
|
+
"data": [
|
16
|
+
{
|
17
|
+
"id": 1329,
|
18
|
+
"name": "Andaman and Nicobar Islands",
|
19
|
+
"priority": 1000,
|
20
|
+
"country": {
|
21
|
+
"id": 100,
|
22
|
+
"name": "India",
|
23
|
+
"iso_name": "INDIA",
|
24
|
+
"dialing_prefix": "91",
|
25
|
+
"priority": 1000
|
26
|
+
}
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"id": 1328,
|
30
|
+
"name": "Andhra Pradesh",
|
31
|
+
"priority": 1000,
|
32
|
+
"country": {
|
33
|
+
"id": 100,
|
34
|
+
"name": "India",
|
35
|
+
"iso_name": "INDIA",
|
36
|
+
"dialing_prefix": "91",
|
37
|
+
"priority": 1000
|
38
|
+
}
|
39
|
+
},
|
40
|
+
.
|
41
|
+
.
|
42
|
+
.
|
43
|
+
{
|
44
|
+
"id": 1332,
|
45
|
+
"name": "Uttaranchal",
|
46
|
+
"priority": 1000,
|
47
|
+
"country": {
|
48
|
+
"id": 100,
|
49
|
+
"name": "India",
|
50
|
+
"iso_name": "INDIA",
|
51
|
+
"dialing_prefix": "91",
|
52
|
+
"priority": 1000
|
53
|
+
}
|
54
|
+
}]
|
55
|
+
}
|
56
|
+
eos
|
57
|
+
|
58
|
+
%>
|
59
|
+
|
60
|
+
<%= render partial: "kuppayam/api/docs/example", locals: {
|
61
|
+
negative_case: false,
|
62
|
+
example_id: "pos_case_2",
|
63
|
+
api_title: api_title,
|
64
|
+
api_input: api_input,
|
65
|
+
api_output: api_output
|
66
|
+
} %>
|
@@ -60,4 +60,13 @@
|
|
60
60
|
|
61
61
|
</div>
|
62
62
|
|
63
|
-
<div style="border-top:1px solid #FFF;margin-top:50px;margin-bottom:70px;"></div>
|
63
|
+
<div style="border-top:1px solid #FFF;margin-top:50px;margin-bottom:70px;"></div>
|
64
|
+
|
65
|
+
|
66
|
+
<div class="dx-warning">
|
67
|
+
<div>
|
68
|
+
<h2>Pattana - API Documentation</h2>
|
69
|
+
<p>All APIs are documented with all cases and examples.</p>
|
70
|
+
<a class="btn btn-success" href="/docs/api/v1/register" target="_blank">Go to the API Documentation</a>
|
71
|
+
</div>
|
72
|
+
</div>
|
data/lib/pattana/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pattana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kpvarma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -398,14 +398,22 @@ files:
|
|
398
398
|
- app/views/pattana/api/v1/docs/cities_in_a_country/_neg_case_1.html.erb
|
399
399
|
- app/views/pattana/api/v1/docs/cities_in_a_country/_pos_case_1.html.erb
|
400
400
|
- app/views/pattana/api/v1/docs/cities_in_a_country/_pos_case_2.html.erb
|
401
|
+
- app/views/pattana/api/v1/docs/cities_in_a_country/_pos_case_3.html.erb
|
402
|
+
- app/views/pattana/api/v1/docs/cities_in_a_country/_pos_case_4.html.erb
|
401
403
|
- app/views/pattana/api/v1/docs/cities_in_a_region/_neg_case_1.html.erb
|
402
404
|
- app/views/pattana/api/v1/docs/cities_in_a_region/_pos_case_1.html.erb
|
403
405
|
- app/views/pattana/api/v1/docs/cities_in_a_region/_pos_case_2.html.erb
|
406
|
+
- app/views/pattana/api/v1/docs/cities_in_a_region/_pos_case_3.html.erb
|
407
|
+
- app/views/pattana/api/v1/docs/cities_in_a_region/_pos_case_4.html.erb
|
404
408
|
- app/views/pattana/api/v1/docs/countries/_pos_case_1.html.erb
|
405
409
|
- app/views/pattana/api/v1/docs/countries/_pos_case_2.html.erb
|
410
|
+
- app/views/pattana/api/v1/docs/countries/_pos_case_3.html.erb
|
411
|
+
- app/views/pattana/api/v1/docs/countries/_pos_case_4.html.erb
|
406
412
|
- app/views/pattana/api/v1/docs/regions/_neg_case_1.html.erb
|
407
413
|
- app/views/pattana/api/v1/docs/regions/_pos_case_1.html.erb
|
408
414
|
- app/views/pattana/api/v1/docs/regions/_pos_case_2.html.erb
|
415
|
+
- app/views/pattana/api/v1/docs/regions/_pos_case_3.html.erb
|
416
|
+
- app/views/pattana/api/v1/docs/regions/_pos_case_4.html.erb
|
409
417
|
- app/views/pattana/cities/_form.html.erb
|
410
418
|
- app/views/pattana/cities/_index.html.erb
|
411
419
|
- app/views/pattana/cities/_row.html.erb
|