q_auth_ruby_client 0.0.8 → 0.0.9

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: 0de4699130ba2772e15813492b4f11cc8efc1c09
4
- data.tar.gz: ba0b02f32817ae89b7bc2c07f3f4efcaf35d711d
3
+ metadata.gz: 4abb1acfc8a0f95d737d9e8fa89ea1c2a6219cd2
4
+ data.tar.gz: a45fbe4060819abffdefaffa63764a09dfa2496e
5
5
  SHA512:
6
- metadata.gz: ca5474ddc54623798e6f47eb69c78482dc2687de7c0e0c305fbb0a4671109d959d743f9a415551b8afac3c4916b1ef00606df663e6a3918a6422bd0cd16759f0
7
- data.tar.gz: be95f7f0e006cc4ddc48a9b442274380bbe98c2c573fe2459eb1cfdcadb25e82032f68906e022f8290ac22df5e5e292896e117e77505fd8b8a64900692f3a06f
6
+ metadata.gz: 2f1c9a738dc9cfd388d70e5e9d6cebb8e6e28513f258c642368a87ec7a1f3c2a43572c0126ab77b546a49d65397bd9b121828fc1ff0fe8f7e6db2e0aece77068
7
+ data.tar.gz: 0758e99466b00245caa513bd6a4fcd8b7894648e5d701e6a58dc05adaf56af3514bc2deec59f9d4f8a2b73fcd58bb6741346aaabb91f6e5cbb46260122a0e57c
@@ -4,6 +4,14 @@ class QAuthRubyClient::User < ActiveRecord::Base
4
4
 
5
5
  self.table_name = 'users'
6
6
 
7
+ # return an active record relation object with the search query in its where clause
8
+ # Return the ActiveRecord::Relation object
9
+ # == Examples
10
+ # >>> user.search(query)
11
+ # => ActiveRecord::Relation object
12
+ scope :search, lambda {|query| where("LOWER(users.name) LIKE LOWER('%#{query}%') OR LOWER(users.username) LIKE LOWER('%#{query}%') OR LOWER(users.email) LIKE LOWER('%#{query}%') OR LOWER(users.phone) LIKE LOWER('%#{query}%') OR LOWER(users.city) LIKE LOWER('%#{query}%') OR LOWER(users.designation) LIKE LOWER('%#{query}%') OR LOWER(users.department) LIKE LOWER('%#{query}%')")}
13
+
14
+
7
15
  def self.fetch_all_users(auth_token)
8
16
  qauth_url = QAuthRubyClient.configuration.q_auth_url + "/api/v1/members"
9
17
  request = Typhoeus::Request.new(
@@ -13,6 +13,12 @@ module QAuthRubyClient
13
13
  helper QAuthRubyClient::NotificationHelper
14
14
  helper QAuthRubyClient::SessionsHelper
15
15
  end
16
+
17
+ config.to_prepare do
18
+ Dir.glob(Rails.root + "app/decorators/**/*_decorator*.rb").each do |c|
19
+ require_dependency(c)
20
+ end
21
+ end
16
22
  end
17
23
  end
18
24
  end
@@ -1,3 +1,3 @@
1
1
  module QAuthRubyClient
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: q_auth_ruby_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krishnaprasad Varma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-01 00:00:00.000000000 Z
11
+ date: 2015-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails