Skip to content

Commit

Permalink
Use have_implicit_order_column matcher only for rails 6
Browse files Browse the repository at this point in the history
  • Loading branch information
yaorlov committed Sep 13, 2019
1 parent 72821a9 commit ea7261f
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 194 deletions.
21 changes: 12 additions & 9 deletions Appraisals
Expand Up @@ -113,24 +113,27 @@ end

if Gem::Requirement.new('>= 2.5.0').satisfied_by?(Gem::Version.new(RUBY_VERSION))
appraise 'rails_6_0' do
instance_eval(&shared_dependencies)
instance_eval(&shared_jruby_dependencies)
instance_eval(&shared_spring_dependencies)
instance_eval(&shared_test_dependencies)

gem 'rails', '~> 6.0.0.beta3'
gem 'rails', '~> 6.0.0'
gem 'puma', '~> 3.11'
gem 'bootsnap', '>= 1.4.1', require: false
gem 'sass-rails', '~> 5.0'
gem 'webpacker', '>= 4.0.0.rc3'
gem 'bootsnap', '>= 1.4.2', require: false
gem 'sass-rails', '~> 5'
gem 'webpacker', '~> 4.0'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'jbuilder', '~> 2.7'
gem 'bcrypt', '~> 3.1.7'
gem 'capybara', '>= 2.15'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
gem 'webdrivers'

# Other dependencies
gem 'rails-controller-testing', '>= 1.0.1'
gem 'pg', '~> 1.1', platform: :ruby
gem 'rails-controller-testing', '>= 1.0.4'
gem 'pg', '>= 0.18', '< 2.0', platform: :ruby
gem 'sqlite3', '~> 1.4', platform: :ruby
end
end
18 changes: 9 additions & 9 deletions gemfiles/rails_6_0.gemfile
Expand Up @@ -20,24 +20,24 @@ gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
gem "jdbc-sqlite3", platform: :jruby
gem "jruby-openssl", platform: :jruby
gem "therubyrhino", platform: :jruby
gem "sqlite3", "~> 1.3.6", platform: :ruby
gem "spring"
gem "spring-commands-rspec"
gem "minitest-reporters"
gem "rspec-rails", "~> 3.6"
gem "shoulda-context", "~> 1.2.0"
gem "rails", "~> 6.0.0.beta3"
gem "rails", "~> 6.0.0"
gem "puma", "~> 3.11"
gem "bootsnap", ">= 1.4.1", require: false
gem "sass-rails", "~> 5.0"
gem "webpacker", ">= 4.0.0.rc3"
gem "bootsnap", ">= 1.4.2", require: false
gem "sass-rails", "~> 5"
gem "webpacker", "~> 4.0"
gem "turbolinks", "~> 5"
gem "jbuilder", "~> 2.5"
gem "jbuilder", "~> 2.7"
gem "bcrypt", "~> 3.1.7"
gem "capybara", ">= 2.15"
gem "listen", ">= 3.0.5", "< 3.2"
gem "spring-watcher-listen", "~> 2.0.0"
gem "selenium-webdriver"
gem "chromedriver-helper"
gem "rails-controller-testing", ">= 1.0.1"
gem "pg", "~> 1.1", platform: :ruby
gem "webdrivers"
gem "rails-controller-testing", ">= 1.0.4"
gem "pg", ">= 0.18", "< 2.0", platform: :ruby
gem "sqlite3", "~> 1.4", platform: :ruby
161 changes: 80 additions & 81 deletions gemfiles/rails_6_0.gemfile.lock
@@ -1,72 +1,71 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (6.0.0.beta3)
actionpack (= 6.0.0.beta3)
actioncable (6.0.0)
actionpack (= 6.0.0)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.0.beta3)
actionpack (= 6.0.0.beta3)
activejob (= 6.0.0.beta3)
activerecord (= 6.0.0.beta3)
activestorage (= 6.0.0.beta3)
activesupport (= 6.0.0.beta3)
actionmailbox (6.0.0)
actionpack (= 6.0.0)
activejob (= 6.0.0)
activerecord (= 6.0.0)
activestorage (= 6.0.0)
activesupport (= 6.0.0)
mail (>= 2.7.1)
actionmailer (6.0.0.beta3)
actionpack (= 6.0.0.beta3)
actionview (= 6.0.0.beta3)
activejob (= 6.0.0.beta3)
actionmailer (6.0.0)
actionpack (= 6.0.0)
actionview (= 6.0.0)
activejob (= 6.0.0)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.0.beta3)
actionview (= 6.0.0.beta3)
activesupport (= 6.0.0.beta3)
actionpack (6.0.0)
actionview (= 6.0.0)
activesupport (= 6.0.0)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actiontext (6.0.0.beta3)
actionpack (= 6.0.0.beta3)
activerecord (= 6.0.0.beta3)
activestorage (= 6.0.0.beta3)
activesupport (= 6.0.0.beta3)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.0.0)
actionpack (= 6.0.0)
activerecord (= 6.0.0)
activestorage (= 6.0.0)
activesupport (= 6.0.0)
nokogiri (>= 1.8.5)
actionview (6.0.0.beta3)
activesupport (= 6.0.0.beta3)
actionview (6.0.0)
activesupport (= 6.0.0)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (6.0.0.beta3)
activesupport (= 6.0.0.beta3)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.0.0)
activesupport (= 6.0.0)
globalid (>= 0.3.6)
activemodel (6.0.0.beta3)
activesupport (= 6.0.0.beta3)
activerecord (6.0.0.beta3)
activemodel (= 6.0.0.beta3)
activesupport (= 6.0.0.beta3)
activestorage (6.0.0.beta3)
actionpack (= 6.0.0.beta3)
activerecord (= 6.0.0.beta3)
activemodel (6.0.0)
activesupport (= 6.0.0)
activerecord (6.0.0)
activemodel (= 6.0.0)
activesupport (= 6.0.0)
activestorage (6.0.0)
actionpack (= 6.0.0)
activejob (= 6.0.0)
activerecord (= 6.0.0)
marcel (~> 0.3.1)
activesupport (6.0.0.beta3)
activesupport (6.0.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 1.3, >= 1.3.1)
zeitwerk (~> 2.1, >= 2.1.8)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
ansi (1.5.0)
appraisal (2.2.0)
bundler
rake
thor (>= 0.14.0)
archive-zip (0.12.0)
io-like (~> 0.3.0)
ast (2.4.0)
bcrypt (3.1.12)
bootsnap (1.4.1)
bootsnap (1.4.5)
msgpack (~> 1.0)
builder (3.2.3)
byebug (11.0.0)
Expand All @@ -80,21 +79,17 @@ GEM
xpath (~> 3.2)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
chromedriver-helper (2.1.0)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
coderay (1.1.2)
concurrent-ruby (1.1.5)
crass (1.0.4)
diff-lcs (1.3)
erubi (1.8.0)
ffi (1.10.0)
ffi (1.11.1)
fssm (0.2.10)
globalid (0.4.2)
activesupport (>= 4.2.0)
i18n (1.6.0)
concurrent-ruby (~> 1.0)
io-like (0.3.0)
jaro_winkler (1.5.2)
jbuilder (2.8.0)
activesupport (>= 4.2.0)
Expand All @@ -112,18 +107,18 @@ GEM
mimemagic (~> 0.3.2)
method_source (0.9.2)
mimemagic (0.3.3)
mini_mime (1.0.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.11.3)
minitest-reporters (1.3.6)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
msgpack (1.2.9)
msgpack (1.3.1)
multi_json (1.13.1)
nio4r (2.3.1)
nokogiri (1.10.3)
nio4r (2.5.1)
nokogiri (1.10.4)
mini_portile2 (~> 2.4.0)
parallel (1.17.0)
parser (2.6.3.0)
Expand All @@ -144,20 +139,20 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.0.beta3)
actioncable (= 6.0.0.beta3)
actionmailbox (= 6.0.0.beta3)
actionmailer (= 6.0.0.beta3)
actionpack (= 6.0.0.beta3)
actiontext (= 6.0.0.beta3)
actionview (= 6.0.0.beta3)
activejob (= 6.0.0.beta3)
activemodel (= 6.0.0.beta3)
activerecord (= 6.0.0.beta3)
activestorage (= 6.0.0.beta3)
activesupport (= 6.0.0.beta3)
rails (6.0.0)
actioncable (= 6.0.0)
actionmailbox (= 6.0.0)
actionmailer (= 6.0.0)
actionpack (= 6.0.0)
actiontext (= 6.0.0)
actionview (= 6.0.0)
activejob (= 6.0.0)
activemodel (= 6.0.0)
activerecord (= 6.0.0)
activestorage (= 6.0.0)
activesupport (= 6.0.0)
bundler (>= 1.3.0)
railties (= 6.0.0.beta3)
railties (= 6.0.0)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.4)
actionpack (>= 5.0.1.x)
Expand All @@ -166,11 +161,11 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.4)
rails-html-sanitizer (1.2.0)
loofah (~> 2.2, >= 2.2.2)
railties (6.0.0.beta3)
actionpack (= 6.0.0.beta3)
activesupport (= 6.0.0.beta3)
railties (6.0.0)
actionpack (= 6.0.0)
activesupport (= 6.0.0)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
Expand Down Expand Up @@ -215,13 +210,13 @@ GEM
ruby-progressbar (1.10.1)
ruby_dep (1.5.0)
rubyzip (1.2.2)
sass (3.7.3)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass-rails (5.1.0)
railties (>= 5.2.0)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
Expand All @@ -244,7 +239,7 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
sqlite3 (1.4.1)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
Expand All @@ -254,17 +249,21 @@ GEM
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.6.0)
webdrivers (4.1.2)
nokogiri (~> 1.6)
rubyzip (~> 1.0)
selenium-webdriver (>= 3.0, < 4.0)
webpacker (4.0.2)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.7.0)
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
websocket-extensions (0.1.4)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.18)
zeitwerk (1.4.3)
zeitwerk (2.1.10)
zeus (0.15.14)
method_source (>= 0.6.7)

Expand All @@ -276,39 +275,39 @@ DEPENDENCIES
activerecord-jdbcsqlite3-adapter
appraisal (= 2.2.0)
bcrypt (~> 3.1.7)
bootsnap (>= 1.4.1)
bootsnap (>= 1.4.2)
bundler (~> 1.1)
capybara (>= 2.15)
chromedriver-helper
fssm
jbuilder (~> 2.5)
jbuilder (~> 2.7)
jdbc-sqlite3
jruby-openssl
listen (>= 3.0.5, < 3.2)
minitest-reporters
pg (~> 1.1)
pg (>= 0.18, < 2.0)
pry
pry-byebug
puma (~> 3.11)
pygments.rb
rails (~> 6.0.0.beta3)
rails-controller-testing (>= 1.0.1)
rails (~> 6.0.0)
rails-controller-testing (>= 1.0.4)
rake (= 12.3.2)
redcarpet
rspec (~> 3.6)
rspec-rails (~> 3.6)
rubocop
rubocop-rails
sass-rails (~> 5.0)
sass-rails (~> 5)
selenium-webdriver
shoulda-context (~> 1.2.0)
spring
spring-commands-rspec
spring-watcher-listen (~> 2.0.0)
sqlite3 (~> 1.3.6)
sqlite3 (~> 1.4)
therubyrhino
turbolinks (~> 5)
webpacker (>= 4.0.0.rc3)
webdrivers
webpacker (~> 4.0)
yard
zeus

Expand Down
Expand Up @@ -2,7 +2,7 @@ module Shoulda
module Matchers
module ActiveRecord
# The `have_implicit_order_column` matcher tests that the model has `implicit_order_column`
# assigned to one of the table columns.
# assigned to one of the table columns. (Rails 6+ only)
#
# class Product < ApplicationRecord
# self.implicit_order_column = :created_at
Expand All @@ -20,8 +20,10 @@ module ActiveRecord
#
# @return [HaveImplicitOrderColumnMatcher]
#
def have_implicit_order_column(column)
HaveImplicitOrderColumnMatcher.new(column)
if RailsShim.active_record_gte_6?
def have_implicit_order_column(column)
HaveImplicitOrderColumnMatcher.new(column)
end
end

# @private
Expand Down

0 comments on commit ea7261f

Please sign in to comment.