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

Skip entity auto-detection when explicitely passed #500

Closed
wants to merge 3 commits into from
Closed

Skip entity auto-detection when explicitely passed #500

wants to merge 3 commits into from

Conversation

yaneq
Copy link
Contributor

@yaneq yaneq commented Nov 6, 2013

The call to .first might cause an unnecessary db call

present SomeModel.active, with: Entities::SomeModel

__generated sql calls

Somemodel Load (1.0ms)  SELECT [...] ORDER BY id LIMIT 1
Somemodel Load (0.4ms)  SELECT [...] ORDER BY id

The first call is to determine the entity, which in this case is not necessary since it has been passed to present

The call to .first might cause an unnecessary db call otherwise
@dblock
Copy link
Member

dblock commented Nov 6, 2013

Do you think you could write a spec for this? I imagine you could do something ensuring .first is not called. Also, please update CHANGELOG.

@dblock
Copy link
Member

dblock commented Nov 6, 2013

Merged squashed via 043b99f, thank you.

@dblock dblock closed this Nov 6, 2013
@yaneq yaneq mentioned this pull request Mar 25, 2014
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

Successfully merging this pull request may close these issues.

2 participants