tiny-record 1.0.2 → 1.1.0

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
  SHA1:
3
- metadata.gz: f96fead1cb349cb0f32e4278636ed1d61e95efff
4
- data.tar.gz: 6f113873c57687e6a72dbad5716ecdc1d9b6b2a9
3
+ metadata.gz: bf57e4cc2dba1320f23fda494a6085e0b40d2192
4
+ data.tar.gz: 3177fdbcdf79fc389e97a981f3aa0e993012c032
5
5
  SHA512:
6
- metadata.gz: f6630145a39f3cec71b4674bb239cb842bfa3b9da6b9d4f0c829e7c634ee81c516700423d76f13b34b363b7e0f175c8c9fdc7725b1866dcd563bc55eb6ce3418
7
- data.tar.gz: 077761dc659108ce24fd8f9a392b793d8929ea746a0d67df4de46762183797b749b7d707c490f7464132ffa2ec5f700cf7af08c9e19dc2a467986630cc2e0cec
6
+ metadata.gz: cf41984edc81a44d9c32b1dac2a1ac9e0f0917ed4e81a64f3def7df5105a058a5a706e3bd534df41b2ce8a3e4d250dda0fa80c34e662f864d722f66f14fe8ed6
7
+ data.tar.gz: b804c658986dd30f9669c76cb1fe491a0fbfa737560da194d232e838897f658a1a8a9a14720df9f93dda32aed574cb619ab59700017b7987aac370d15fab25f0
@@ -0,0 +1,8 @@
1
+ ### 1.0.3 - 2019-06-08
2
+
3
+ * Enhancements
4
+ * Added fetch_where which can be used as :
5
+ ```ruby
6
+ User.fetch_where(city: "london", with: [:first_name, :last_name])
7
+ ```
8
+ to get fetch records with their first and last name.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tiny-record (1.0.2)
4
+ tiny-record (1.1.0)
5
5
  activerecord (>= 4.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  [![Build Status](https://travis-ci.com/vikasvr/tiny-record.svg?branch=master)](https://travis-ci.com/vikasvr/tiny-record)
2
+ [![Gem Version](https://badge.fury.io/rb/tiny-record.svg)](https://badge.fury.io/rb/tiny-record)
2
3
 
3
4
  # TinyRecord
4
5
 
5
- TinyRecord gives to you the capability to target columns when you try to look for active record objects specifying the columns you want to use which gives you speed. Logic is simple, less the data you will ask for, faster database response would be.
6
+ TinyRecord gives to you the capability to target columns when you try to look for active record objects specifying the columns you want to use.
6
7
 
7
8
  ## Installation
8
9
 
@@ -20,6 +20,11 @@ module TinyRecord
20
20
  get(columns, with).take
21
21
  end
22
22
 
23
+ def fetch_where(columns = {})
24
+ with = columns.delete(:with)
25
+ get(columns, with)
26
+ end
27
+
23
28
  def get(by_columns, with_columns)
24
29
  collection = where(by_columns)
25
30
  collection = collection.select(with_columns) if with_columns.present?
@@ -1,5 +1,5 @@
1
1
  module Tiny
2
2
  module Record
3
- VERSION = "1.0.2"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny-record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vikas Verma
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-10 00:00:00.000000000 Z
11
+ date: 2019-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -104,6 +104,7 @@ extra_rdoc_files: []
104
104
  files:
105
105
  - ".gitignore"
106
106
  - ".travis.yml"
107
+ - CHANGELOG.md
107
108
  - CODE_OF_CONDUCT.md
108
109
  - Gemfile
109
110
  - Gemfile.lock