Deprecate `{insert|update|delete}_sql` in `DatabaseStatements` #23086

Merged
merged 1 commit into from Mar 2, 2016

Conversation

Projects
None yet
6 participants
@kamipo
Member

kamipo commented Jan 17, 2016

Originally, {insert|update|delete}_sql is protected methods.
We can use the {insert|update|delete} public methods instead.

https://github.com/rails/rails/blob/v5.0.0.beta1/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb#L378-L392

@rails-bot

This comment has been minimized.

Show comment
Hide comment
@rails-bot

rails-bot Jan 17, 2016

r? @chancancode

(@rails-bot has picked a reviewer for you, use r? to override)

r? @chancancode

(@rails-bot has picked a reviewer for you, use r? to override)

@kamipo

This comment has been minimized.

Show comment
Hide comment
@kamipo

kamipo Jan 21, 2016

Member

In Rails 3.0, {insert|update|delete}_sql is used in {insert|update|delete}.

https://github.com/rails/rails/blob/3-0-stable/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb#L43-L55

Currently {insert|update|delete}_sql is replaced to exec_{insert|update|delete} for using bind parameters.

8571fac
f1df6b2
1d7c033

I think that we don't use {insert|update|delete}_sql anymore in the internal.

r? @rafaelfranca

Member

kamipo commented Jan 21, 2016

In Rails 3.0, {insert|update|delete}_sql is used in {insert|update|delete}.

https://github.com/rails/rails/blob/3-0-stable/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb#L43-L55

Currently {insert|update|delete}_sql is replaced to exec_{insert|update|delete} for using bind parameters.

8571fac
f1df6b2
1d7c033

I think that we don't use {insert|update|delete}_sql anymore in the internal.

r? @rafaelfranca

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Jan 29, 2016

Member

Could you add a CHANGELOG entry?

Member

rafaelfranca commented Jan 29, 2016

Could you add a CHANGELOG entry?

@kamipo

This comment has been minimized.

Show comment
Hide comment
@kamipo

kamipo Jan 29, 2016

Member

I added a CHANGELOG entry!

Member

kamipo commented Jan 29, 2016

I added a CHANGELOG entry!

@vipulnsward

This comment has been minimized.

Show comment
Hide comment
@vipulnsward

vipulnsward Jan 29, 2016

Member

Needs a deprecation test?

Member

vipulnsward commented Jan 29, 2016

Needs a deprecation test?

Deprecate `{insert|update|delete}_sql` in `DatabaseStatements`
Originally, `{insert|update|delete}_sql` is protected methods.
We can use the `{insert|update|delete}` public methods instead.
@kamipo

This comment has been minimized.

Show comment
Hide comment
@kamipo

kamipo Mar 2, 2016

Member

Added a deprecation test.
Do we still keep these methods in Rails 5.0 or later?

Member

kamipo commented Mar 2, 2016

Added a deprecation test.
Do we still keep these methods in Rails 5.0 or later?

rafaelfranca added a commit that referenced this pull request Mar 2, 2016

Merge pull request #23086 from kamipo/deprecate_insert_update_delete_sql
Deprecate `{insert|update|delete}_sql` in `DatabaseStatements`

@rafaelfranca rafaelfranca merged commit 31b8903 into rails:master Mar 2, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@kamipo kamipo deleted the kamipo:deprecate_insert_update_delete_sql branch Mar 2, 2016

yahonda added a commit to yahonda/oracle-enhanced that referenced this pull request Jun 24, 2016

@yahonda yahonda referenced this pull request in rsim/oracle-enhanced Jun 24, 2016

Merged

Rename `insert_sql` to `exec_insert` #866

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment