Upgrade to Rails 5.1, gem `query_reviewer` and deprecated method `alias_method_chain`

Multi tool use
Multi tool use









1















Rails community!



I'm having an issue about upgrading on Rails project from Rails 4.2 to Rails 5.2, issue related to the step from Rails 5.0 to 5.1



/gems/query_reviewer-0.2.2/lib/query_reviewer/mysql_adapter_extensions.rb:4:in `included': undefined method `alias_method_chain' for ActiveRecord::ConnectionAdapters::Mysql2Adapter:Class (NoMethodError)


I've read a lot of related questions here, and I understood that method alias_method_chains is deprecated with Rails 5.1...



However, here, issue comes from a gem, especially gem query_reviewer (github, rubygems):
Last version of this gem is 0.2.2 (septembre 16, 2013) and includes the deprecated method:



module QueryReviewer
module MysqlAdapterExtensions
def self.included(base)
base.alias_method_chain :select, :review
base.alias_method_chain :update, :review
base.alias_method_chain :insert, :review
base.alias_method_chain :delete, :review
end


Obviously, this gem is not available with Rails 5.1, and obvious but painful option would be to look for an other gem... But, maybe, someone had the same issue and found a better way to answer to this 1st question as StackOverflow user ;) ?



Thanks by advance










share|improve this question

















  • 2





    Fork, rewrite it and point gem to your new repo gem 'query_reviewer ', :git => 'git://github.com/username/repo.git':)

    – mkrl
    Nov 14 '18 at 16:54












  • This is unfortunately the only solution if you want to use Rails 5.x with a gem not designed for it - and it's easier than it sounds!

    – Mark
    Nov 14 '18 at 17:22











  • Especially in this case since it should be as simple as using Module#prepend This Article might help

    – engineersmnky
    Nov 14 '18 at 17:29
















1















Rails community!



I'm having an issue about upgrading on Rails project from Rails 4.2 to Rails 5.2, issue related to the step from Rails 5.0 to 5.1



/gems/query_reviewer-0.2.2/lib/query_reviewer/mysql_adapter_extensions.rb:4:in `included': undefined method `alias_method_chain' for ActiveRecord::ConnectionAdapters::Mysql2Adapter:Class (NoMethodError)


I've read a lot of related questions here, and I understood that method alias_method_chains is deprecated with Rails 5.1...



However, here, issue comes from a gem, especially gem query_reviewer (github, rubygems):
Last version of this gem is 0.2.2 (septembre 16, 2013) and includes the deprecated method:



module QueryReviewer
module MysqlAdapterExtensions
def self.included(base)
base.alias_method_chain :select, :review
base.alias_method_chain :update, :review
base.alias_method_chain :insert, :review
base.alias_method_chain :delete, :review
end


Obviously, this gem is not available with Rails 5.1, and obvious but painful option would be to look for an other gem... But, maybe, someone had the same issue and found a better way to answer to this 1st question as StackOverflow user ;) ?



Thanks by advance










share|improve this question

















  • 2





    Fork, rewrite it and point gem to your new repo gem 'query_reviewer ', :git => 'git://github.com/username/repo.git':)

    – mkrl
    Nov 14 '18 at 16:54












  • This is unfortunately the only solution if you want to use Rails 5.x with a gem not designed for it - and it's easier than it sounds!

    – Mark
    Nov 14 '18 at 17:22











  • Especially in this case since it should be as simple as using Module#prepend This Article might help

    – engineersmnky
    Nov 14 '18 at 17:29














1












1








1








Rails community!



I'm having an issue about upgrading on Rails project from Rails 4.2 to Rails 5.2, issue related to the step from Rails 5.0 to 5.1



/gems/query_reviewer-0.2.2/lib/query_reviewer/mysql_adapter_extensions.rb:4:in `included': undefined method `alias_method_chain' for ActiveRecord::ConnectionAdapters::Mysql2Adapter:Class (NoMethodError)


I've read a lot of related questions here, and I understood that method alias_method_chains is deprecated with Rails 5.1...



However, here, issue comes from a gem, especially gem query_reviewer (github, rubygems):
Last version of this gem is 0.2.2 (septembre 16, 2013) and includes the deprecated method:



module QueryReviewer
module MysqlAdapterExtensions
def self.included(base)
base.alias_method_chain :select, :review
base.alias_method_chain :update, :review
base.alias_method_chain :insert, :review
base.alias_method_chain :delete, :review
end


Obviously, this gem is not available with Rails 5.1, and obvious but painful option would be to look for an other gem... But, maybe, someone had the same issue and found a better way to answer to this 1st question as StackOverflow user ;) ?



Thanks by advance










share|improve this question














Rails community!



I'm having an issue about upgrading on Rails project from Rails 4.2 to Rails 5.2, issue related to the step from Rails 5.0 to 5.1



/gems/query_reviewer-0.2.2/lib/query_reviewer/mysql_adapter_extensions.rb:4:in `included': undefined method `alias_method_chain' for ActiveRecord::ConnectionAdapters::Mysql2Adapter:Class (NoMethodError)


I've read a lot of related questions here, and I understood that method alias_method_chains is deprecated with Rails 5.1...



However, here, issue comes from a gem, especially gem query_reviewer (github, rubygems):
Last version of this gem is 0.2.2 (septembre 16, 2013) and includes the deprecated method:



module QueryReviewer
module MysqlAdapterExtensions
def self.included(base)
base.alias_method_chain :select, :review
base.alias_method_chain :update, :review
base.alias_method_chain :insert, :review
base.alias_method_chain :delete, :review
end


Obviously, this gem is not available with Rails 5.1, and obvious but painful option would be to look for an other gem... But, maybe, someone had the same issue and found a better way to answer to this 1st question as StackOverflow user ;) ?



Thanks by advance







ruby-on-rails ruby rubygems






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 16:44









Polo M2BPolo M2B

62




62







  • 2





    Fork, rewrite it and point gem to your new repo gem 'query_reviewer ', :git => 'git://github.com/username/repo.git':)

    – mkrl
    Nov 14 '18 at 16:54












  • This is unfortunately the only solution if you want to use Rails 5.x with a gem not designed for it - and it's easier than it sounds!

    – Mark
    Nov 14 '18 at 17:22











  • Especially in this case since it should be as simple as using Module#prepend This Article might help

    – engineersmnky
    Nov 14 '18 at 17:29













  • 2





    Fork, rewrite it and point gem to your new repo gem 'query_reviewer ', :git => 'git://github.com/username/repo.git':)

    – mkrl
    Nov 14 '18 at 16:54












  • This is unfortunately the only solution if you want to use Rails 5.x with a gem not designed for it - and it's easier than it sounds!

    – Mark
    Nov 14 '18 at 17:22











  • Especially in this case since it should be as simple as using Module#prepend This Article might help

    – engineersmnky
    Nov 14 '18 at 17:29








2




2





Fork, rewrite it and point gem to your new repo gem 'query_reviewer ', :git => 'git://github.com/username/repo.git':)

– mkrl
Nov 14 '18 at 16:54






Fork, rewrite it and point gem to your new repo gem 'query_reviewer ', :git => 'git://github.com/username/repo.git':)

– mkrl
Nov 14 '18 at 16:54














This is unfortunately the only solution if you want to use Rails 5.x with a gem not designed for it - and it's easier than it sounds!

– Mark
Nov 14 '18 at 17:22





This is unfortunately the only solution if you want to use Rails 5.x with a gem not designed for it - and it's easier than it sounds!

– Mark
Nov 14 '18 at 17:22













Especially in this case since it should be as simple as using Module#prepend This Article might help

– engineersmnky
Nov 14 '18 at 17:29






Especially in this case since it should be as simple as using Module#prepend This Article might help

– engineersmnky
Nov 14 '18 at 17:29













0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305033%2fupgrade-to-rails-5-1-gem-query-reviewer-and-deprecated-method-alias-method-c%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305033%2fupgrade-to-rails-5-1-gem-query-reviewer-and-deprecated-method-alias-method-c%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







u7xn8HO93hMxH d f3,ac 07 4POXmCmXN0USPdxuLd,b5cGXqTLT2WY8NAQ 0vjJw0cmcz0Y4lH,N
7HKEJ J3BCC5Hrefco3d1gPCn tAz

Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo