mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
When using :pluck, ActiveRecord trigger the query immediately.
The above is a behavior we probably want to avoid, because
implies a query to the database regarless of the role or
permission.
** Before
osem_1 | 07:39:11 web.1 | Started GET "/" for 172.20.0.1 at 2019-07-1207:39:11 +0000
osem_1 | 07:39:11 web.1 | (0.3ms) SELECT
"conferences"."custom_domain" FROM "conferences" WHERE
("conferences"."custom_domain" IS NOT NULL) ORDER BY start_date DESC
osem_1 | 07:39:11 web.1 | Processing by ConferencesController#index as HTML
osem_1 | 07:39:11 web.1 | (1.3ms) SELECT "events"."id" FROM
"events" WHERE "events"."state" = $ 1 [["state", "confirmed"]]
osem_1 | 07:39:11 web.1 | ↳ app/models/ability.rb:39:in `not_signed_in'
osem_1 | 07:39:11 web.1 | Rendering layouts/application.html.haml
osem_1 | 07:39:11 web.1 | Rendering conferences/index.html.haml within layouts/application
** After
osem_1 | 07:43:18 web.1 | Started GET "/" for 172.20.0.1 at 2019-07-1207:43:18 +0000
osem_1 | 07:43:19 web.1 | (0.2ms) SELECT
"conferences"."custom_domain" FROM "conferences" WHERE
("conferences"."custom_domain" IS NOT NULL) ORDER BY start_date DESC
osem_1 | 07:43:19 web.1 | Processing by ConferencesController#index as HTML
osem_1 | 07:43:19 web.1 | Rendering layouts/application.html.haml
osem_1 | 07:43:19 web.1 | Rendering conferences/index.html.haml within layouts/application
|
||
|---|---|---|
| .. | ||
| concerns | ||
| .gitkeep | ||
| ability.rb | ||
| admin_ability.rb | ||
| answer.rb | ||
| application_record.rb | ||
| booth.rb | ||
| booth_request.rb | ||
| cfp.rb | ||
| comment.rb | ||
| commercial.rb | ||
| conference.rb | ||
| contact.rb | ||
| difficulty_level.rb | ||
| email_settings.rb | ||
| event.rb | ||
| event_schedule.rb | ||
| event_type.rb | ||
| event_user.rb | ||
| events_registration.rb | ||
| lodging.rb | ||
| openid.rb | ||
| organization.rb | ||
| payment.rb | ||
| physical_ticket.rb | ||
| program.rb | ||
| qanswer.rb | ||
| question.rb | ||
| question_type.rb | ||
| registration.rb | ||
| registration_period.rb | ||
| resource.rb | ||
| role.rb | ||
| room.rb | ||
| schedule.rb | ||
| splashpage.rb | ||
| sponsor.rb | ||
| sponsorship_level.rb | ||
| subscription.rb | ||
| survey.rb | ||
| survey_question.rb | ||
| survey_reply.rb | ||
| survey_submission.rb | ||
| ticket.rb | ||
| ticket_purchase.rb | ||
| ticket_scanning.rb | ||
| track.rb | ||
| user.rb | ||
| users_role.rb | ||
| vchoice.rb | ||
| vday.rb | ||
| venue.rb | ||
| vote.rb | ||
| vposition.rb | ||