Skip to content

Releases: bespokepost/questionable

Rails 5 compatibility

29 Apr 14:28
Compare
Choose a tag to compare
Version 0.4.0 (#22)

* Rails 5

* Fix for params

> Calling params in your application will now return an object instead of a hash. If your parameters are already permitted, then you will not need to make any changes. If you are using map and other methods that depend on being able to read the hash regardless of permitted? you will need to upgrade your application to first permit and then convert to a hash.

http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#actioncontroller-parameters-no-longer-inherits-from-hashwithindifferentaccess

* Fix some things that changed with Rails 5

* CodeClimate

* Deprecation warning

* set ruby version

* Circle CI

* Codeclimate

* Codeclimate

* code climate

* Fix for migration issue

```
Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

  class CreateQuestionableQuestions < ActiveRecord::Migration[4.2]
```

* Fix for migration issue with Dummy app

```
Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

  class CreateQuestionableQuestions < ActiveRecord::Migration[4.2]
```

* Fix exception with migrations

```
StandardError: An error has occurred, this and all later migrations canceled:

Index name 'index_admin_notes_on_admin_user_type_and_admin_user_id' on table 'admin_notes' already exists
```

The `references` takes care of it this

* Fix another migration exception

Fix for:

```
-- Updating any existing comments to the admin namespace.
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

undefined method `proper_table_name' for ActiveRecord::Migrator:Class
/home/ubuntu/questionable/spec/dummy/db/migrate/20130124193419_move_admin_notes_to_comments.rb:13:in `up'
```

http://guides.rubyonrails.org/4_2_release_notes.html#active-record-removals

* Fix deprecation

```
DEPRECATION WARNING: `redirect_to :back` is deprecated and will be removed from Rails 5.1. Please use `redirect_back(fallback_location: fallback_location)` where `fallback_location` represents the location to use if the request has no HTTP referer information. (called from redirect_to_back at /Users/jhales/projects/questionable/app/controllers/questionable/answers_controller.rb:59)
```

* Deprecation warnings

Also seems to cause issues in Circle CI:

```
      Questionable::AnswersController POST #create when we post a valid date should save the date
      Failure/Error: post :create, answers: { date_assignment.id => [ valid_date ] }, use_route: :answers

      ArgumentError:
        unknown keywords: answers, use_route
      # ./spec/dummy/spec/controllers/questionable/answers_controller_spec.rb:71:in `block (5 levels) in <module:Questionable>'
      # ./spec/dummy/spec/controllers/questionable/answers_controller_spec.rb:70:in `block (4 levels) in <module:Questionable>'
```

* Fix for deprecation

```
DEPRECATION WARNING: You didn't set `secret_key_base`. Read the upgrade documentation to learn more about this new config option. (called from load at /Users/jhales/.rvm/gems/ruby-2.2.6/bin/rspec:23)
```

* Fix spec deprecations

* increment version

* Codeclimate

* Remove trailing whitespace

* `or` to `||`

* `or` to `||`

* `.kind_of?` to `.is_a?`

* code review

Just trying to make everything work with Rails 5 and cleanup a few minor code style items, I did NOT really do anything to make the code/gem better

https://github.com/bespokepost/questionable/pull/22

* fix circle ci