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

not compatible with rails 3.1rc4 #17

Open
gillesmathurin opened this issue Jun 30, 2011 · 19 comments
Open

not compatible with rails 3.1rc4 #17

gillesmathurin opened this issue Jun 30, 2011 · 19 comments

Comments

@gillesmathurin
Copy link

Hi, unfortunately it doesn't work with rails 3.1rc4 (at leat on my app) - using rvm and ruby 1.9.2p-180

@purcell
Copy link
Collaborator

purcell commented Jun 30, 2011

By "it doesn't work", do you mean that slim_scrooge fails to install, fails to intercept queries, or throws an error?

I'm a contributor, not the author, but I'm sure more detailed information would be welcome.

I would note, however, that when I upgraded an app which used slim_scrooge to Rails 3.0, I found the overall performance was slightly better without slim_scrooge, so if you're considering slim_scrooge as an optimization for your Rails 3.1 app, it may or may be your best option.

-Steve

@sdsykes
Copy link
Owner

sdsykes commented Jun 30, 2011

Steve: yes - I think because Rails 3 is already lazy about sending queries to the DB, slim scrooge may or may not help depending on your app.

Gilles: yes, more info on what happens would be helpful.

@gillesmathurin
Copy link
Author

Hi, well you are right, by doesn't work i mean it prevents queries to be made. Simple test, create an app with rails 3.1rc4 , add a simple model (like Post) add an index action Post.all and see the app throwing an error while accessing the index page , the same happens in the rails console …

i may have miss something though (not as smart) as you guys

@algritz
Copy link

algritz commented Oct 27, 2011

I can confirm the issue, I had a 3.0.9 app that I upgraded to 3.1.1, a simple User.find stopped working => ( I had logged the following issue on rails rails/rails#3452).

As soon a I removed reference to slims_scrooge and updated my bundle, it worked.

Windows 7
Ruby 1.8.7 (patch 352)
Rails 3.1.1

@sdsykes
Copy link
Owner

sdsykes commented Oct 30, 2011

I'll have time to investigate, but it'll be in a couple of days. In the mean time, pull requests are welcome...

@algritz
Copy link

algritz commented Oct 30, 2011

I'm in no rush, as my app suffer other issues elsewhere anyway. (I can't pre-compile assests)

@alecslupu
Copy link

hello!
I am having the same issue ... from what i have seen .... my problem resides somewhere in :

lib / slim_scrooge / slim_scrooge.rb line #13

and i think that is because it is not compatible with arel:

here is my stack trace: https://gist.github.com/1360276

@andreydjason
Copy link

Hi, I'm having the same issue, btw the log dont return an specific location for the error file or line number.

wrong number of arguments (2 for 1)
(removing the gem, the app works well)

Ubuntu 11.10
Ruby 1.9.2
Rails 3.1.0

@sdsykes
Copy link
Owner

sdsykes commented Nov 17, 2011

I'm sorry I haven't had time to look at this. Thanks for the reports, this weekend should provide me an opportunity.

@sdsykes
Copy link
Owner

sdsykes commented Nov 25, 2011

Thie issue is that the internal API has changed here, and we are now getting an Arel object instead of the SQL.

In fact this could be beneficial, because we can manipulate the query better while it is in Arel, but it's going to take a little while to figure out and test.

@alecslupu
Copy link

Yeah ... is there any way i could help you ?
i am rails noob, but maybe i could help you with something ...

@sdsykes
Copy link
Owner

sdsykes commented Nov 26, 2011

Now I have a modified version that is partially working, more testing to do though.

If you can find out the best way to modify an ARel SelectManager object to vary the select columns, that would certainly be of use, because at the moment I am delving inside it, which is not ideal.

@bhushangahire
Copy link
Contributor

This issue is not yet resolved on Rails 3.2. Its breaking on User.find

@aarthiraj561
Copy link

Hi.. i am facing the same problem with slim_scrooge.

I added gem slim_scrooge to my gemfile and bundle installed and run the server. It gives me an error in the line which just do a simple User.find .... Also when i uncomment the slim_scrooge from the gemfile and restart it works....

May i know what is the problem and also if you can provide me any other alternative gem to this?

Thanks

@jimmckerchar
Copy link

Is there any progress on this?

I've had a quick look and have (potentially) a fix that works with Rails 3.1.3

It looks like binds=[] should be passed as a parameter to find_by_sql_with_slim_scrooge

def find_by_sql_with_slim_scrooge(sql, binds = [])

and then passing it on to

rows = connection.select_all(sql, "#{name} Load SlimScrooged 1st time", binds)

Can anyone clarify?

@sdsykes
Copy link
Owner

sdsykes commented Oct 9, 2012

Are you using the latest version in this repo?

See here
6d1645f

@jimmckerchar
Copy link

@sdsykes It would appear not. Thanks

@MSeneadza
Copy link

BTW, I just tried using v 1.0.13 against a PostgreSQL db. It crashes like this "PG::Error: ERROR: column "1" does not exist
LINE 1: ...erride_fb_pic","users"."id" FROM "users" WHERE "id" IN ("1")"
That "1" is an integer and shouldn't have quotes around it.

bradphilips added a commit to bradphilips/slim_scrooge that referenced this issue Apr 11, 2013
BTW, I just tried using v 1.0.13 against a PostgreSQL db. It crashes like this "PG::Error: ERROR: column "1" does not exist
LINE 1: ...erride_fb_pic","users"."id" FROM "users" WHERE "id" IN ("1")"
That "1" is an integer and shouldn't have quotes around it.
@bradphilips
Copy link

All, I've submitted a pull request for this issue. Seems in a postgresql context the quote_column_name was causing the arguments to be quoted instead of verbatim. This is my first pull to this repository; so let me know if I missed something as I wasn't able to run the specs because of setup issues. Was getting the 'test/helper' doesn't exist which implies this was being dev'd under an older version of ruby (I'm on 1.9.3). Thanks!

scryptmouse pushed a commit to lazuli/slim_scrooge that referenced this issue Jun 11, 2014
BTW, I just tried using v 1.0.13 against a PostgreSQL db. It crashes like this "PG::Error: ERROR: column "1" does not exist
LINE 1: ...erride_fb_pic","users"."id" FROM "users" WHERE "id" IN ("1")"
That "1" is an integer and shouldn't have quotes around it.
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

No branches or pull requests