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

attribute should not require a connection is established #2138

Closed
wants to merge 1 commit into from

Conversation

koic
Copy link
Collaborator

@koic koic commented Feb 5, 2021

Follow rails/rails#41302.

rails/rails#41302 changed the behaviour adapter_name_from.

Below are the differences based on that implementation.

Before

Test3Employee.connection.adapter_name.downcase.to_sym
# => :oracleenhanced

After

Test3Employee.connection_db_config.adapter.to_sym
# => :oracle_enhanced

This PR conforms to the new behavior of adapter_name_from and
fixes the following build error.

% bundle exec rspec

(snip)

rspec ./spec/active_record/oracle_enhanced/type/boolean_spec.rb:116 #
OracleEnhancedAdapter boolean type detection based on string column
types and names / VARCHAR2 boolean values from ActiveRecord model should
return boolean value from VARCHAR2 boolean column if
emulate_booleans_from_strings is true
rspec ./spec/active_record/oracle_enhanced/type/boolean_spec.rb:141 #
OracleEnhancedAdapter boolean type detection based on string column
types and names / VARCHAR2 boolean values from ActiveRecord model should
return boolean value from VARCHAR2 boolean column if attribute is set to
:boolean

https://github.com/rsim/oracle-enhanced/runs/1822500989

Follow rails/rails#41302.

rails/rails#41302 changed the behaviour `adapter_name_from`.

Below are the differences based on that implementation.

## Before

```console
Test3Employee.connection.adapter_name.downcase.to_sym
# => :oracleenhanced
```

## After

```console
Test3Employee.connection_db_config.adapter.to_sym
# => :oracle_enhanced
```

This PR conforms to the new behavior of `adapter_name_from` and
fixes the following build error.

```console
% bundle exec rspec

(snip)

rspec ./spec/active_record/oracle_enhanced/type/boolean_spec.rb:116 #
OracleEnhancedAdapter boolean type detection based on string column
types and names / VARCHAR2 boolean values from ActiveRecord model should
return boolean value from VARCHAR2 boolean column if
emulate_booleans_from_strings is true
rspec ./spec/active_record/oracle_enhanced/type/boolean_spec.rb:141 #
OracleEnhancedAdapter boolean type detection based on string column
types and names / VARCHAR2 boolean values from ActiveRecord model should
return boolean value from VARCHAR2 boolean column if attribute is set to
:boolean
```

https://github.com/rsim/oracle-enhanced/runs/1822500989
@koic koic mentioned this pull request Feb 5, 2021
@yahonda
Copy link
Collaborator

yahonda commented Feb 5, 2021

Would you rebase this pull request based on the latest master branch?

@yahonda
Copy link
Collaborator

yahonda commented Feb 5, 2021

Please ignore my previous comment because I was thinking #2136 has been merged to master but it has not been yet.

@yahonda
Copy link
Collaborator

yahonda commented Feb 5, 2021

Would you push this dcd501b to #2136 ? #2136 and this #2138 require each other.

@koic
Copy link
Collaborator Author

koic commented Feb 5, 2021

Yup. I've cherry-picked the commit to #2136 and I will close this PR. Thank you for your review.

@koic koic closed this Feb 5, 2021
@koic koic deleted the should_not_require_connection branch February 5, 2021 08:15
@yahonda
Copy link
Collaborator

yahonda commented Feb 5, 2021

Thanks.

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