usman 0.4.8.pre.materialize → 0.4.9.pre.materialize

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66dc8ae67a0f4b53e9c47c8bddd8d29c3779d87bcfe022e8cee1864e2fb3cfc1
4
- data.tar.gz: ab508cc18eecdd1573af41bdc55f66b26b55a3732d7a88e274d35752bdc3c20e
3
+ metadata.gz: '0589427dbb92c0128edc21fb10657689fe415d88cb62fe46e3ccf99bce92bb10'
4
+ data.tar.gz: 991ff93acbb80917fefaa86ad0280d990530a4af28e06e083e477cae7036f4a2
5
5
  SHA512:
6
- metadata.gz: 874a83bd0cbae9dd9d942fb8e5c537084a9bb48e7dec9ffdd574fdf7161f358391a41637d998d51d1e82daaf763e096816f8b0e85190b8abdded1a71b99cb208
7
- data.tar.gz: e633d77de6328007a0cd4f3b63c49e71c13a36073ad6fb82588a34c920abbaabb9d4e89f088637fa8cecbec1042bb4514be5310576226df5c1ecbc5f294abffc
6
+ metadata.gz: 60e1d2dca5a38ee6fd8d4e95d0134a6a71b5d7e9956dca5a01f96335f282ca399f59dfe074371cf1c915bb6e1cc7c3fb9d5a1fa0290b239f8aa000447fec2b40
7
+ data.tar.gz: 7857d2b5a02c4622caa519cbf0e2b94332428708bc1fa7d67ebc4987cdd8e9bcddf37308f0272f9b42316d007d6bdb9d38b9e54e8e9fb2728c98a0cc6f43ac8a
data/app/models/user.rb CHANGED
@@ -454,13 +454,17 @@ class User < Usman::ApplicationRecord
454
454
  case role
455
455
 
456
456
  when String
457
- self.roles.where(name: role).count > 0
457
+ # self.roles.where(name: role).count > 0
458
+ self.roles.select{|x| x.name == role }.count > 0
458
459
  when Integer
459
- self.roles.where(id: role).count > 0
460
+ # self.roles.where(id: role).count > 0
461
+ self.roles.select{|x| x.id == role }.count > 0
460
462
  when Array
461
- self.roles.where(name: role).count > 0
463
+ # self.roles.where(name: role).count > 0
464
+ self.roles.select{|x| role.include?(x.name) }.count > 0
462
465
  when Role
463
- self.roles.where(id: role.id).count > 0
466
+ # self.roles.where(id: role.id).count > 0
467
+ self.roles.select{|x| x == role }.count > 0
464
468
  else
465
469
  return false
466
470
  end
data/lib/usman/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Usman
2
- VERSION = '0.4.8.pre.materialize'
2
+ VERSION = '0.4.9.pre.materialize'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8.pre.materialize
4
+ version: 0.4.9.pre.materialize
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-15 00:00:00.000000000 Z
11
+ date: 2018-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -104,14 +104,14 @@ dependencies:
104
104
  requirements:
105
105
  - - ">="
106
106
  - !ruby/object:Gem::Version
107
- version: 0.2.8.pre.materialize
107
+ version: 0.2.11.pre.materialize
108
108
  type: :runtime
109
109
  prerelease: false
110
110
  version_requirements: !ruby/object:Gem::Requirement
111
111
  requirements:
112
112
  - - ">="
113
113
  - !ruby/object:Gem::Version
114
- version: 0.2.8.pre.materialize
114
+ version: 0.2.11.pre.materialize
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: pattana
117
117
  requirement: !ruby/object:Gem::Requirement