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

Rails 4: DEPRECATION WARNING #27

Closed
johanneswuerbach opened this issue Oct 7, 2013 · 3 comments
Closed

Rails 4: DEPRECATION WARNING #27

johanneswuerbach opened this issue Oct 7, 2013 · 3 comments

Comments

@johanneswuerbach
Copy link
Contributor

I updated to from 0.1.14 ~> 0.1.16 and receive now the following deprecation warning with Rails 4.

DEPRECATION WARNING: #connection is deprecated in favour of accessing it via the class.

I tried to run the counter_culter tests on my local machine with rake and rspec, but it looks like there is a loop somewhere. (ruby 2.0)

Excerpt from the console output:

D, [2013-10-07T16:44:40.118517 #38558] DEBUG -- :    (1.2ms)  commit transaction
D, [2013-10-07T16:44:40.119292 #38558] DEBUG -- :    (0.1ms)  begin transaction
D, [2013-10-07T16:44:40.121151 #38558] DEBUG -- :   SQL (0.5ms)  INSERT INTO "simple_dependents" ("created_at", "simple_main_id", "updated_at") VALUES (?, ?, ?)  [["created_at", Mon, 07 Oct 2013 23:44:40 UTC +00:00], ["simple_main_id", 3610], ["updated_at", Mon, 07 Oct 2013 23:44:40 UTC +00:00]]
D, [2013-10-07T16:44:40.122453 #38558] DEBUG -- :   SimpleMain Load (0.1ms)  SELECT "simple_mains".* FROM "simple_mains" WHERE "simple_mains"."id" = ? ORDER BY "simple_mains"."id" ASC LIMIT 1  [["id", 3610]]
D, [2013-10-07T16:44:40.124705 #38558] DEBUG -- :    (1.6ms)  commit transaction
D, [2013-10-07T16:44:40.128017 #38558] DEBUG -- :   SQL (2.0ms)  UPDATE "simple_mains" SET "simple_dependents_count" = COALESCE("simple_dependents_count", 0) + 1 WHERE "simple_mains"."id" = 3610
D, [2013-10-07T16:44:40.128639 #38558] DEBUG -- :    (0.2ms)  begin transaction
D, [2013-10-07T16:44:40.131126 #38558] DEBUG -- :   SQL (0.6ms)  INSERT INTO "simple_dependents" ("created_at", "simple_main_id", "updated_at") VALUES (?, ?, ?)  [["created_at", Mon, 07 Oct 2013 23:44:40 UTC +00:00], ["simple_main_id", 3610], ["updated_at", Mon, 07 Oct 2013 23:44:40 UTC +00:00]]
D, [2013-10-07T16:44:40.132465 #38558] DEBUG -- :   SimpleMain Load (0.1ms)  SELECT "simple_mains".* FROM "simple_mains" WHERE "simple_mains"."id" = ? ORDER BY "simple_mains"."id" ASC LIMIT 1  [["id", 3610]]
D, [2013-10-07T16:44:40.134285 #38558] DEBUG -- :    (1.3ms)  commit transaction
D, [2013-10-07T16:44:40.136665 #38558] DEBUG -- :   SQL (1.4ms)  UPDATE "simple_mains" SET "simple_dependents_count" = COALESCE("simple_dependents_count", 0) + 1 WHERE "simple_mains"."id" = 3610
D, [2013-10-07T16:44:40.136985 #38558] DEBUG -- :    (0.1ms)  begin transaction
D, [2013-10-07T16:44:40.139417 #38558] DEBUG -- :   SQL (0.9ms)  INSERT INTO "simple_dependents" ("created_at", "simple_main_id", "updated_at") VALUES (?, ?, ?)  [["created_at", Mon, 07 Oct 2013 23:44:40 UTC +00:00], ["simple_main_id", 3610], ["updated_at", Mon, 07 Oct 2013 23:44:40 UTC +00:00]]
D, [2013-10-07T16:44:40.140599 #38558] DEBUG -- :   SimpleMain Load (0.1ms)  SELECT "simple_mains".* FROM "simple_mains" WHERE "simple_mains"."id" = ? ORDER BY "simple_mains"."id" ASC LIMIT 1  [["id", 3610]]
D, [2013-10-07T16:44:40.142350 #38558] DEBUG -- :    (1.2ms)  commit transaction
D, [2013-10-07T16:44:40.144588 #38558] DEBUG -- :   SQL (1.5ms)  UPDATE "simple_mains" SET "simple_dependents_count" = COALESCE("simple_dependents_count", 0) + 1 WHERE "simple_mains"."id" = 3610
D, [2013-10-07T16:44:40.145144 #38558] DEBUG -- :    (0.1ms)  begin transaction
D, [2013-10-07T16:44:40.147456 #38558] DEBUG -- :   SQL (0.9ms)  INSERT INTO "simple_mains" ("created_at", "updated_at") VALUES (?, ?)  [["created_at", Mon, 07 Oct 2013 23:44:40 UTC +00:00], ["updated_at", Mon, 07 Oct 2013 23:44:40 UTC +00:00]]
D, [2013-10-07T16:44:40.154149 #38558] DEBUG -- :    (6.1ms)  commit transaction
@johanneswuerbach
Copy link
Contributor Author

The warning was introduced with 0.1.16 and I think this line is the problem: https://github.com/magnusvk/counter_culture/blob/master/lib/counter_culture.rb#L282 , but can't test as the test suite is currently not working for me.

@magnusvk
Copy link
Owner

magnusvk commented Oct 8, 2013

Johannes -- you just have to be a little patient with the test suite. It
creates thousands of records on purpose to text whether fixing counts still
works. That being said, I sped it up a bit by reducing the number of
records created.

0.1.17 should fix your deprecation warning.

On Mon, Oct 7, 2013 at 7:56 PM, Johannes Würbach
notifications@github.comwrote:

The warning was introduced with 0.1.16 and I think this line is the
problem:
https://github.com/magnusvk/counter_culture/blob/master/lib/counter_culture.rb#L282, but can't test as the test suite is currently not working for me.


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-25855261
.

@johanneswuerbach
Copy link
Contributor Author

Thanks was fast 👍 , for the tests you could probably replace circleci with travis so there is a public available test output to compare against.

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

2 participants