activerecord-uuid-order 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 46ccacecb167a4f9947f8c02f46f8548ebf754c7f26f4c2079b88fb3b3825134
4
+ data.tar.gz: 2029830b9f0faf2f79d068042a8dc3448ae15ce4d9b58ce3c74ab273e4742ca5
5
+ SHA512:
6
+ metadata.gz: b6a9a22072254118e0a3fe7e03dcdc76b0cc9509576b0c2cf46e2f8d9d9da5e330b2ccaf4b8dc1483aaca66d1cb0733d64a5bf462b3a539d29fafa1f68f7fb9b
7
+ data.tar.gz: d7fa905eb498f5f62f9adadf0e411117cae281451e306b8263e5191e5c73fc1bb6300e86a68b59141263b0936ce58b983dc6467c1e0fb8970aa83aa32d274933
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ Gemfile.lock
2
+ .ruby-version
3
+ pkg/
4
+ *.gem
5
+ coverage/
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 pawurb
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # ActiveRecord UUID Order
2
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -0,0 +1,18 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ require 'activerecord-uuid-order/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "activerecord-uuid-order"
8
+ gem.version = ActiveRecordUUIDOrder::VERSION
9
+ gem.authors = ["pawurb"]
10
+ gem.email = ["contact@pawelurbanek.com"]
11
+ gem.summary = %q{ Order for UUID }
12
+ gem.description = %q{ Order for UUID }
13
+ gem.homepage = "http://github.com/pawurb/activerecord-uuid-order"
14
+ gem.files = `git ls-files`.split("\n")
15
+ gem.require_paths = ["lib"]
16
+ gem.license = "MIT"
17
+ gem.add_dependency "activerecord", "< 6.0.0"
18
+ end
@@ -0,0 +1,14 @@
1
+ require 'activerecord-uuid-order/version'
2
+ require 'activerecord-uuid-order/core_extensions'
3
+
4
+ module ActiveRecordUUIDOrder
5
+ included do
6
+ def self.implicit_order_column=(value)
7
+ @@implicit_order_column = value
8
+ end
9
+
10
+ def self.implicit_order_column
11
+ @@implicit_order_column
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ module ActiveRecord
2
+ module FinderMethods
3
+ def ordered_relation
4
+ if order_values.empty? && (implicit_order_column || primary_key)
5
+ order(arel_attribute(implicit_order_column || primary_key).asc)
6
+ else
7
+ self
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module ActiveRecordUUIDOrder
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activerecord-uuid-order
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - pawurb
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-10-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activerecord
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "<"
18
+ - !ruby/object:Gem::Version
19
+ version: 6.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "<"
25
+ - !ruby/object:Gem::Version
26
+ version: 6.0.0
27
+ description: " Order for UUID "
28
+ email:
29
+ - contact@pawelurbanek.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - Gemfile
36
+ - LICENSE.txt
37
+ - README.md
38
+ - Rakefile
39
+ - activerecord-uuid-order.gemspec
40
+ - lib/activerecord-uuid-order.rb
41
+ - lib/activerecord-uuid-order/core_extensions.rb
42
+ - lib/activerecord-uuid-order/version.rb
43
+ homepage: http://github.com/pawurb/activerecord-uuid-order
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubygems_version: 3.0.3
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Order for UUID
66
+ test_files: []