query_optimizer 0.1.4 → 0.1.4.1

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: 44b32ac494ec80e6312efc98513f669dffbc1c55
4
- data.tar.gz: 67212322656adebcdfa0844d9a67af76b0e49732
3
+ metadata.gz: a4ba5ffff4c072fa6aa16b4a7730c26bcdfbf336
4
+ data.tar.gz: 61bd033570dd1dec6b21558b0958fdc61cb84ade
5
5
  SHA512:
6
- metadata.gz: c8525bdf459d7fa634a5d8364e659261b126811b63c783dd67fe7b2ee2bcf3adce82361a88652a9bd5a859d1a22f78246febc82048bed06cbc853a66df2d687e
7
- data.tar.gz: f6149a7af5461d70027a6a8c6f4a94d8a7ecfe6cdc04ee19645ee4af8f55525005b4c0c4eb24aae7a79cfb27c29d99503b4aac28a5a9c9c50a6dfe936a92432f
6
+ metadata.gz: c32e0fcebf3fed8653d2f2892cac5026abcc09fb0394ebb144611450727ff4133a04114c5ea368e180115fb710f1acff8f6114923e0d836d59a9cae04b70b05f
7
+ data.tar.gz: 448a9b70eb01bb3beb71b4f1e39a27167be6768c66090de69a00276188528ac2cb807ea887d1409b6fbcd115671914bb77719eed9cd84b3995d80bbe1bebe193
data/README.rdoc CHANGED
@@ -6,9 +6,9 @@
6
6
 
7
7
  == FEATURES:
8
8
 
9
- query_optimizer is the best gem for optimizing query in rails for has_many or has_one and belongs_to relationship two tables.
9
+ query_optimizer is the best gem for optimizing query in rails for has_many or has_one and belongs_to relationship.
10
10
  In rails If you want all posts and its related comments in a single query than you can't get it
11
- as Post.incldes(:comments) or Post.joins(:comments) will return only posts array and Comment.incldes(:posts) will return only comments array
11
+ as Post.includes(:comments) or Post.joins(:comments) will return only posts array and Comment.includes(:posts) will return only comments array
12
12
  For fetching each post comment you have to fire query from view as below output of post.comments in each with index loop.
13
13
 
14
14
  Started GET "/" for 127.0.0.1 at 2015-10-18 14:12:11 +0530
@@ -17,7 +17,7 @@ module QueryOptimizer
17
17
  end
18
18
  end
19
19
  tables = args.map{|p| p.to_s}.join(',')
20
- return ActiveRecord::Base.connection.select_all("SELECT #{aliases.join(',')} FROM #{tables} where #{joins.join(' ')}").to_a.sort{ |x, y| y["#{args.first.to_s}_id"] <=> x["#{args.first.to_s}_id"] }
20
+ return ActiveRecord::Base.connection.select_all("SELECT #{aliases.join(',')} FROM #{tables} where #{joins.join(' ')} ORDER BY #{args.first.to_s}_id desc").to_a
21
21
  end
22
22
  end
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module QueryOptimizer
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_optimizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akshay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-19 00:00:00.000000000 Z
11
+ date: 2015-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler