Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update specs and drop support for ruby 2.0.0 #824

Merged
merged 1 commit into from
Aug 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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