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.
@@ -12,7 +12,7 @@ describe Vehicle do
12
12
  }
13
13
  @vehicles.each { |name, vehicle|
14
14
  vehicle.reload
15
- vehicle.update_attribute :parking_order_position, 0
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].update_attribute :parking_order_position, :first
24
- @vehicles[:ford].update_attribute :parking_order_position, :first
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
- ROOT = File.join(File.dirname(__FILE__), '..')
5
-
6
- DB_CONFIG = ENV["DB"] || "sqlite"
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(DB_CONFIG.to_sym)
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
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: 2019-03-23 00:00:00.000000000 Z
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.1.16
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.1.16
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: 10.1.0
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: 10.1.0
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 3 & 4. It
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
- rubyforge_project:
187
- rubygems_version: 2.5.2.2
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 3 & 4
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
@@ -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: "../"