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

Allow rails 5.1 usage #856

Merged
merged 1 commit into from
May 19, 2017
Merged

Conversation

tiagoamaro
Copy link
Contributor

Hello,

First, thank you very much for this gem! It's extremely useful, as its code is quite impressive and clean 🎉 very nice job!

This PR is my attempt to allow Rails 5.1 usage, while keeping the entire test suite green. There are some deprecation warnings, but they're related to database_cleaner:

DEPRECATION WARNING: schema_migrations_table_name is deprecated and will be removed from Rails 5.2 (called from block (2 levels) in <top (required)> at /Users/tiago/Projects/test_apps/administrate/spec/support/database_cleaner.rb:11)

Ran bundle exec rake && bundle exec appraisal rake and everything passed fine :)
Also, I'm currently using my fork on a project in production, and it seems to be working fine.

Note: I've noticed a PR to support Rails 5.1 (#782), but it seems it's tackling more than just allowing this new Rails version to be used, so I decided to open this one.

end
end

if Rails::VERSION::MAJOR >= 5
if Gem::Dependency.new('rails', '~> 5.0.0').match?('rails', Rails::VERSION::STRING)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.


def delete(path, params = nil, headers = nil)
super(path, params: params, headers: headers)
if Gem::Dependency.new('rails', '~> 5.1.0').match?('rails', Rails::VERSION::STRING)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@nickcharlton nickcharlton added this to the v0.8.0 milestone May 3, 2017
@BenMorganIO
Copy link
Collaborator

BenMorganIO commented May 3, 2017

#782 was me trying to keep things up to date for a project as well. It's kinda me backporting stuff. I need to close it and reopen with a new PR. It's just got gotten messy. Thanks for tackling this!

@nickcharlton
Copy link
Member

Thanks @tiagoamaro!

I'm not sure yet how I want to go about merging these two, but it's the focus for v0.8.0. I'll be coming back to this soon!

@nickcharlton
Copy link
Member

On #782, we were blocked by rails/sass-rails#400, which was merged today. Does this help us at all here?

end
end

if Rails::VERSION::MAJOR >= 5
if Gem::Dependency.new("rails", "~> 5.0.0").match?("rails", Rails::VERSION::STRING)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [83/80]


def delete(path, params = nil, headers = nil)
super(path, params: params, headers: headers)
if Gem::Dependency.new("rails", "~> 5.1.0").match?("rails", Rails::VERSION::STRING)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [83/80]

@nickcharlton
Copy link
Member

The tests are failing because Rails 5 and up doesn't like unversioned migrations, so I'm going to worry about that in another PR and merge this. Thanks!

@nickcharlton nickcharlton merged commit 396a31d into thoughtbot:master May 19, 2017
@tiagoamaro tiagoamaro deleted the allow-rails-5-1 branch May 19, 2017 13:32
@stevensona stevensona mentioned this pull request May 30, 2017
iarie pushed a commit to iarie/administrate that referenced this pull request Jun 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants