gcountry 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gcountry.rb +28 -0
- metadata +47 -0
data/lib/gcountry.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
module Gcountry
|
2
|
+
class Country
|
3
|
+
def get_all_with_pagination(page, role, model)
|
4
|
+
@page = page
|
5
|
+
@role = role
|
6
|
+
@model = model
|
7
|
+
if !@role || @role == "all"
|
8
|
+
if @role == "all"
|
9
|
+
@option = "All"
|
10
|
+
else
|
11
|
+
@option = "Select Filter"
|
12
|
+
end
|
13
|
+
@data = @model.desc(:created_at).page(@page).per(10)
|
14
|
+
else
|
15
|
+
if @role == "0"
|
16
|
+
@option = "Published"
|
17
|
+
elsif @role == "1"
|
18
|
+
@option = "Unpublished"
|
19
|
+
else
|
20
|
+
@option = "Trashed"
|
21
|
+
|
22
|
+
end
|
23
|
+
@data = @model.where(:status => @role).desc(:created_at).page(@page).per(10)
|
24
|
+
end
|
25
|
+
return @data, @option
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gcountry
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Ganesh Kunwar
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-01 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description:
|
15
|
+
email:
|
16
|
+
- gkunwar@braindigit.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- lib/gcountry.rb
|
22
|
+
homepage:
|
23
|
+
licenses: []
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 1.8.23
|
43
|
+
signing_key:
|
44
|
+
specification_version: 3
|
45
|
+
summary: This is country selection gem
|
46
|
+
test_files: []
|
47
|
+
has_rdoc:
|