changed rails dependency "~>4.2" to ">= 4.2" - #3
Conversation
|
Hi @brijeshror, First of all, thanks for this PR. Unfortunately it doesn't seem to be compatible with Rails 5.2 : if you try to launch the gem tests after upgrading Rails, you'll get this error : % bundle exec rake
...
55 examples, 0 failures, 1 pending
% bundle update rails
...
Using rails 5.2.0 (was 4.2.9)
Using rails_wordpress 0.2.1 from source at `.`
Bundle updated!
% bundle exec rake
rake aborted!
NoMethodError: undefined method `sqlite3=' for #<Class:0x007fbd0864a650>
/Users/jlestavel/Work/github/rails_wordpress/lib/rails_wordpress/railtie.rb:9:in `block (3 levels) in <class:Railtie>'
/Users/jlestavel/Work/github/rails_wordpress/lib/rails_wordpress/railtie.rb:9:in `each'
/Users/jlestavel/Work/github/rails_wordpress/lib/rails_wordpress/railtie.rb:9:in `block (2 levels) in <class:Railtie>'It seems related to https://github.com/rails/rails/pull/29699/files. I started to look at what I can do to fix that but in fact I'm a bit embarrassed that the gem now forces Thanks for your help 😃 , Julien PS : @mwlang of course your opinion is welcome too ! |
simplecovin rspec instead ofcodeclimate-test-reporter, because Usage ofCode Climate Test Reporteris deprecated in version +1.0Look https://docs.codeclimate.com/v1.0/docs/test-coverage-ruby to use codeclimate now.
Removed Active Record call back config
config.active_record.raise_in_transactional_callbacks. No longer required.Reference : http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#error-handling-in-transaction-callbacks
Added railtie to set active_record config
belongs_to_required_by_defaultto false, Because to resolve validation errors,Error rises when trying to create record without defining association
belongs_tofield value in which default value specified at DB level.Either we can use
optionalorrequiredoptions in belongs_to association. Or we can add active_record configbelongs_to_required_by_defaultto resolve this issue.References :
http://blog.bigbinary.com/2016/02/15/rails-5-makes-belong-to-association-required-by-default.html
https://stackoverflow.com/questions/38983666/validation-failed-class-must-exist/38986580#38986580
http://edgeguides.rubyonrails.org/5_0_release_notes.html#active-record-notable-changes