ranked-model 0.4.4 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/.travis.yml +32 -25
- data/Appraisals +40 -35
- data/Gemfile +12 -0
- data/Readme.mkd +61 -12
- data/gemfiles/rails_4_2.gemfile +8 -7
- data/gemfiles/rails_5_0.gemfile +8 -8
- data/gemfiles/rails_5_1.gemfile +8 -8
- data/gemfiles/rails_5_2.gemfile +7 -4
- data/gemfiles/rails_6_0.gemfile +22 -0
- data/gemfiles/rails_6_1.gemfile +22 -0
- data/lib/ranked-model/ranker.rb +356 -351
- data/lib/ranked-model/version.rb +1 -1
- data/lib/ranked-model.rb +1 -1
- data/ranked-model.gemspec +4 -4
- data/spec/duck-model/column_default_ducks_spec.rb +1 -1
- data/spec/duck-model/duck_spec.rb +84 -46
- data/spec/duck-model/lots_of_ducks_spec.rb +29 -33
- data/spec/ego-model/ego_spec.rb +3 -3
- data/spec/number-model/number_spec.rb +10 -2
- data/spec/player-model/records_already_exist_spec.rb +1 -1
- data/spec/ranked-model/ranker_spec.rb +18 -0
- data/spec/sti-model/element_spec.rb +24 -24
- data/spec/sti-model/vehicle_spec.rb +4 -4
- data/spec/support/active_record.rb +7 -5
- metadata +16 -16
- data/gemfiles/rails_4_1.gemfile +0 -22
@@ -12,7 +12,7 @@ describe Vehicle do
|
|
12
12
|
}
|
13
13
|
@vehicles.each { |name, vehicle|
|
14
14
|
vehicle.reload
|
15
|
-
vehicle.
|
15
|
+
vehicle.update :parking_order_position => 0
|
16
16
|
}
|
17
17
|
@vehicles.each {|name, vehicle| vehicle.reload }
|
18
18
|
}
|
@@ -20,8 +20,8 @@ describe Vehicle do
|
|
20
20
|
describe "ranking by STI parent" do
|
21
21
|
|
22
22
|
before {
|
23
|
-
@vehicles[:volvo].
|
24
|
-
@vehicles[:ford].
|
23
|
+
@vehicles[:volvo].update :parking_order_position => :first
|
24
|
+
@vehicles[:ford].update :parking_order_position => :first
|
25
25
|
}
|
26
26
|
|
27
27
|
describe "Vehicle" do
|
@@ -72,4 +72,4 @@ describe Vehicle do
|
|
72
72
|
|
73
73
|
end
|
74
74
|
|
75
|
-
end
|
75
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'active_record'
|
2
2
|
require 'logger'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
unless ENV['DB']
|
5
|
+
ENV['DB'] = 'sqlite'
|
6
|
+
end
|
7
7
|
|
8
8
|
ActiveRecord::Base.logger = Logger.new('tmp/ar_debug.log')
|
9
9
|
ActiveRecord::Base.configurations = YAML::load(IO.read('spec/support/database.yml'))
|
10
|
-
ActiveRecord::Base.establish_connection(
|
10
|
+
ActiveRecord::Base.establish_connection(ENV['DB'].to_sym)
|
11
11
|
|
12
12
|
ActiveRecord::Schema.define :version => 0 do
|
13
13
|
create_table :ducks, :force => true do |t|
|
@@ -21,6 +21,8 @@ ActiveRecord::Schema.define :version => 0 do
|
|
21
21
|
t.string :pond
|
22
22
|
end
|
23
23
|
|
24
|
+
add_index :ducks, [:landing_order, :lake_id, :flock_id], unique: true
|
25
|
+
|
24
26
|
create_table :wrong_scope_ducks, :force => true do |t|
|
25
27
|
t.string :name
|
26
28
|
t.integer :size
|
@@ -148,7 +150,7 @@ class MotorBike < Vehicle
|
|
148
150
|
end
|
149
151
|
|
150
152
|
class Ego < ActiveRecord::Base
|
151
|
-
primary_key = :alternative_to_id
|
153
|
+
self.primary_key = :alternative_to_id
|
152
154
|
include RankedModel
|
153
155
|
ranks :size
|
154
156
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ranked-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Beale
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
19
|
+
version: '4.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.
|
26
|
+
version: '4.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 12.3.3
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 12.3.3
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: appraisal
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
-
description: ranked-model is a modern row sorting library built for Rails
|
125
|
+
description: ranked-model is a modern row sorting library built for Rails 4.2+. It
|
126
126
|
uses ARel aggressively and is better optimized than most other libraries.
|
127
127
|
email:
|
128
128
|
- matt.beale@madhatted.com
|
@@ -138,11 +138,12 @@ files:
|
|
138
138
|
- LICENSE
|
139
139
|
- Rakefile
|
140
140
|
- Readme.mkd
|
141
|
-
- gemfiles/rails_4_1.gemfile
|
142
141
|
- gemfiles/rails_4_2.gemfile
|
143
142
|
- gemfiles/rails_5_0.gemfile
|
144
143
|
- gemfiles/rails_5_1.gemfile
|
145
144
|
- gemfiles/rails_5_2.gemfile
|
145
|
+
- gemfiles/rails_6_0.gemfile
|
146
|
+
- gemfiles/rails_6_1.gemfile
|
146
147
|
- lib/ranked-model.rb
|
147
148
|
- lib/ranked-model/railtie.rb
|
148
149
|
- lib/ranked-model/ranker.rb
|
@@ -168,7 +169,7 @@ homepage: https://github.com/mixonic/ranked-model
|
|
168
169
|
licenses:
|
169
170
|
- MIT
|
170
171
|
metadata: {}
|
171
|
-
post_install_message:
|
172
|
+
post_install_message:
|
172
173
|
rdoc_options: []
|
173
174
|
require_paths:
|
174
175
|
- lib
|
@@ -183,11 +184,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
184
|
- !ruby/object:Gem::Version
|
184
185
|
version: '0'
|
185
186
|
requirements: []
|
186
|
-
|
187
|
-
|
188
|
-
signing_key:
|
187
|
+
rubygems_version: 3.2.32
|
188
|
+
signing_key:
|
189
189
|
specification_version: 4
|
190
|
-
summary: An acts_as_sortable replacement built for Rails
|
190
|
+
summary: An acts_as_sortable replacement built for Rails 4.2+
|
191
191
|
test_files:
|
192
192
|
- spec/duck-model/column_default_ducks_spec.rb
|
193
193
|
- spec/duck-model/duck_spec.rb
|
data/gemfiles/rails_4_1.gemfile
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "activerecord", "~> 4.1.16"
|
6
|
-
|
7
|
-
group :sqlite do
|
8
|
-
gem "sqlite3", "~> 1.3.13", platform: :ruby
|
9
|
-
gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.24", platform: :jruby
|
10
|
-
end
|
11
|
-
|
12
|
-
group :mysql do
|
13
|
-
gem "mysql2", "~> 0.3.21", platform: :ruby
|
14
|
-
gem "activerecord-jdbcmysql-adapter", "~> 1.3.24", platform: :jruby
|
15
|
-
end
|
16
|
-
|
17
|
-
group :postgresql do
|
18
|
-
gem "pg", "~> 0.18.0", platform: :ruby
|
19
|
-
gem "activerecord-jdbcpostgresql-adapter", "~> 1.3.24", platform: :jruby
|
20
|
-
end
|
21
|
-
|
22
|
-
gemspec path: "../"
|