arel-mysql-index-hint 0.1.2 → 0.1.3

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: 243154f93cd1a66d1f97b1c1f7a4b262eeab8739
4
- data.tar.gz: 4e85f62d35712c7c718d08aacc31206949e0ae77
3
+ metadata.gz: e433fd8290f9349c0e86772ece267aa611800ccc
4
+ data.tar.gz: a83ef70e8c11b80ce7abc94167ac69dbc9fcfa12
5
5
  SHA512:
6
- metadata.gz: 89a435f9127708456efad60d6912b98b3c8598d5f51f86c64d78a010d210c94d357f70417615c4f43efdd1a847c2b75f040d060d95ce687e2dbbf34fb4f55c16
7
- data.tar.gz: 19e57e41253edd21929317188e8e3985ee857820590e1c170ccd316956ea8af87e9c4592200803da2bec9e9fe4f20e602404a8b63c4db76ee885c2e2c0c66755
6
+ metadata.gz: 2a380d743800bbf28a6046d3e1c30b83100c279ce2d2b98dcf928ac1886db880b403703951aff81becea95cdfa8c4bfb3937f9b12c1a5d7afaee48ef49e8de64
7
+ data.tar.gz: 68fa23137460618b48075bb2056ec01bea2c28da9408512c8e2f0ccc45bb649f2954a3ce0a28cf1367c74cb05a07e4d74f80e88b7696c15fa70f684a08aabc1f
data/README.md CHANGED
@@ -26,11 +26,15 @@ Or install it yourself as:
26
26
 
27
27
  ```ruby
28
28
  Article.hint(idx_article: :force)
29
- # => "SELECT `articles`.* FROM `articles` force INDEX (idx_article)"
29
+ #=> "SELECT `articles`.* FROM `articles` FORCE INDEX (`idx_article`)"
30
30
 
31
31
  Article.joins(:comments).hint(articles: {idx_article: :use})
32
- # => "SELECT `articles`.* FROM `articles` use INDEX (idx_article) INNER JOIN `comments` ON `comments`
32
+ #=> "SELECT `articles`.* FROM `articles` USE INDEX (`idx_article`) INNER JOIN `comments` ON `comments`
33
33
 
34
34
  Article.joins(:comments).hint(comments: {idx_comment: :force})
35
- # => "SELECT `articles`.* FROM `articles` INNER JOIN `comments` force INDEX (idx_comment) ON `comments"
35
+ #=> "SELECT `articles`.* FROM `articles` INNER JOIN `comments` FORCE INDEX (`idx_comment`) ON `comments"
36
36
  ```
37
+
38
+ ## Related Links
39
+
40
+ * [MySQL::MySQL 5.6 Reference Manual::13.2.9.3 Index Hint Syntax](https://dev.mysql.com/doc/refman/5.6/en/index-hints.html)
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "arel-mysql-index-hint"
4
- spec.version = "0.1.2"
4
+ spec.version = "0.1.3"
5
5
  spec.authors = ["Genki Sugawara"]
6
6
  spec.email = ["sgwr_dts@yahoo.co.jp"]
7
7
  spec.summary = %q{Add index hint to MySQL query in Arel.}
@@ -11,10 +11,11 @@ module ArelMysqlIndexHint
11
11
  end
12
12
 
13
13
  def mysql_index_hint_value
14
- @values[:mysql_index_hint] ||= {}.with_indifferent_access
14
+ @values[:mysql_index_hint]
15
15
  end
16
16
 
17
17
  def hint(index_hint_by_table)
18
+ self.mysql_index_hint_value ||= {}.with_indifferent_access
18
19
  mysql_index_hint_value.update(index_hint_by_table)
19
20
  self
20
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arel-mysql-index-hint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara