Skip to content

Conversation

@flackou
Copy link

@flackou flackou commented May 2, 2018

Following my comment on PR #3, I propose this change to fix the error raised on app loading with Rails 5.2 :

NoMethodError: undefined method `sqlite3=' for ActiveRecord::Base:Class
.../rails_wordpress/lib/rails_wordpress/railtie.rb:9

My opinion is that the gem should not change the belongs_to_required_by_default config of its parent application. In my company, we use rails_wordpress as a Rails engine in a larger app, with another database and other models living aside. They should not be concerned by this setting. So I suggest to replace this global config by individual optional: true on every belongs_to association declaration (as suggested by @brijeshror himself in his initial PR #3). I added a test on creating a Post without parent.

I also update the Rails locked dependency (used in tests) to latest 5.2 version.

Julien Lestavel added 3 commits May 2, 2018 13:42
…e` by individual `optional: true` on every `belongs_to` association

We don't want the gem Engine to change the config of its parent Rails app
… without parent, it will use the column's default value 0
@SpiffyStores
Copy link

It would be good if this could get sorted out as we are trying to use this under Rails 5.2 as well.

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.

2 participants