find_with_order 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/find_with_order.gemspec +3 -3
- data/gemfiles/3.2.gemfile +1 -0
- data/gemfiles/4.2.gemfile +1 -0
- data/gemfiles/5.0.gemfile +1 -0
- data/lib/find_with_order/version.rb +1 -1
- data/lib/find_with_order.rb +7 -0
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb63ce7cc3c9a7a3f40cc9a3654dff8341b83693
|
4
|
+
data.tar.gz: 92bed035a6036c6c8b8ef35fa7ef59962ce3f42c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f812bb289265d92ee0ee6b3cf49265b2e8de116e20001f0bedf25169665361c466fdd938182cc0e8b4b1784d5ed2b3bfd5359e684a27c482eb2af543f7e8f79
|
7
|
+
data.tar.gz: fee919bde9d1e21ba3e6a4921b1e2d6e4e266b1ab29aabc5c8881a18317b99142cb7b7fbb2ac6e5013c33d8fe2ec9a8c74639bf38de0167d0c4a3f614730d5c5
|
data/README.md
CHANGED
data/find_with_order.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["khiav reoy"]
|
10
10
|
spec.email = ["mrtmrt15xn@yahoo.com.tw"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{
|
12
|
+
spec.summary = %q{Find records in the same order of input IDs.}
|
13
|
+
spec.description = %q{Find records in the same order of input IDs. Supports Rails 3+.}
|
14
14
|
spec.homepage = "https://github.com/khiav223577/find_with_order"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
@@ -29,9 +29,9 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_development_dependency "bundler", "~> 1.11"
|
31
31
|
spec.add_development_dependency "rake", "~> 12.0"
|
32
|
-
spec.add_development_dependency "mysql2", "~> 0.3.21"
|
33
32
|
spec.add_development_dependency "minitest", "~> 5.0"
|
34
33
|
|
35
34
|
spec.add_dependency "rails", ">= 3"
|
35
|
+
spec.add_dependency "mysql2", ">= 0.3"
|
36
36
|
|
37
37
|
end
|
data/gemfiles/3.2.gemfile
CHANGED
data/gemfiles/4.2.gemfile
CHANGED
data/gemfiles/5.0.gemfile
CHANGED
data/lib/find_with_order.rb
CHANGED
@@ -8,3 +8,10 @@ class << ActiveRecord::Base
|
|
8
8
|
where(id: ids).order("field(id, #{ids.join(',')})")
|
9
9
|
end
|
10
10
|
end
|
11
|
+
unless ActiveRecord::Base.respond_to?(:none) # extend only if not implement yet
|
12
|
+
class ActiveRecord::Base
|
13
|
+
def self.none #For Rails 3
|
14
|
+
where('1=0')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: find_with_order
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- khiav reoy
|
@@ -39,48 +39,48 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '12.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '5.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
54
|
+
version: '5.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rails
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
62
|
-
type: :
|
61
|
+
version: '3'
|
62
|
+
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '3'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: mysql2
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '3'
|
75
|
+
version: '0.3'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '3'
|
83
|
-
description:
|
82
|
+
version: '0.3'
|
83
|
+
description: Find records in the same order of input IDs. Supports Rails 3+.
|
84
84
|
email:
|
85
85
|
- mrtmrt15xn@yahoo.com.tw
|
86
86
|
executables: []
|
@@ -124,5 +124,5 @@ rubyforge_project:
|
|
124
124
|
rubygems_version: 2.6.8
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
|
-
summary:
|
127
|
+
summary: Find records in the same order of input IDs.
|
128
128
|
test_files: []
|