Skip to content

Commit

Permalink
Fixed specs for jruby, skip tests for ruby-2.0.0 and add tests for ru…
Browse files Browse the repository at this point in the history
…by-2.4.0 (#824)
  • Loading branch information
avokhmin authored and parndt committed Aug 1, 2017
1 parent 718b1bc commit d765548
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
14 changes: 5 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ language: ruby
cache: bundler

rvm:
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- jruby-9.0.4.0

env:
Expand All @@ -19,19 +19,15 @@ gemfile:
- gemfiles/Gemfile.rails-5.0.rb

matrix:
allow_failures:
- rvm: jruby-19mode
gemfile: gemfiles/Gemfile.rails-4.2.rb
env: DB=postgres
- rvm: jruby-9.0.4.0
gemfile: gemfiles/Gemfile.rails-5.0.rb
exclude:
- rvm: 2.0.0
gemfile: gemfiles/Gemfile.rails-5.0.rb
- rvm: 2.1.0
gemfile: gemfiles/Gemfile.rails-5.0.rb
- rvm: 2.2.0
gemfile: gemfiles/Gemfile.rails-5.0.rb
- rvm: 2.4.0
gemfile: gemfiles/Gemfile.rails-4.0.rb
- rvm: 2.4.0
gemfile: gemfiles/Gemfile.rails-4.1.rb

sudo: false

Expand Down
4 changes: 2 additions & 2 deletions gemfiles/Gemfile.rails-5.0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# Database Configuration
group :development, :test do
platforms :jruby do
gem 'activerecord-jdbcmysql-adapter', '~> 1.3.14'
gem 'activerecord-jdbcpostgresql-adapter', '~> 1.3.14'
gem 'activerecord-jdbcmysql-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter.git', branch: 'rails-5'
gem 'activerecord-jdbcpostgresql-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter.git', branch: 'rails-5'
gem 'kramdown'
end

Expand Down
5 changes: 4 additions & 1 deletion lib/friendly_id/finder_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ def exists_by_friendly_id?(id)
private

def potential_primary_key?(id)
case primary_key_type
key_type = primary_key_type
# Hook for "ActiveModel::Type::Integer" instance.
key_type = key_type.type if key_type.respond_to?(:type)
case key_type
when :integer
Integer(id, 10) rescue false
when :uuid
Expand Down
3 changes: 1 addition & 2 deletions test/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def up

slugged_tables.each do |table_name|
add_column table_name, :slug, :string
add_index table_name, :slug, :unique => true
add_index table_name, :slug, :unique => true if 'novels' != table_name
end

scoped_tables.each do |table_name|
Expand All @@ -44,7 +44,6 @@ def up
# This will be used to test scopes
add_column :novels, :novelist_id, :integer
add_column :novels, :publisher_id, :integer
remove_index :novels, :slug
add_index :novels, [:slug, :publisher_id, :novelist_id], :unique => true

# This will be used to test column name quoting
Expand Down

0 comments on commit d765548

Please sign in to comment.