-
Notifications
You must be signed in to change notification settings - Fork 123
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 5 support #85
Open
inbeom
wants to merge
37
commits into
jashmenn:master
Choose a base branch
from
inbeom:rails5
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rails 5 support #85
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As of ActiveRecord 5.0 monkey-patchings initiated by ActiveUUID::Patches.apply! do not modify Mysql2Adapter and/or SQLite3Adapter of ActiveRecord because they are not loaded by the time the apply! method is invoked. To load patches properly on loading time, we override ActiveRecord::Base.establish_connection method to load the patches immediately after connections are established.
As loading order of activeuuid and connection establishment in spec_helper has been switched.
Can we merge this ASAP? |
Rails 5 + MySQL, SQLite support
Previous spec failures were from changed behaviour of described_class on RSpec 3.x, which referenced the innermost `context' instead of `describe'.
Issue on rails/rails#25125 causes an infinite loop on rails < 5.0
Update dependencies and drop EOL-ed rubies/rails
@rafaelsales I started maintaining my fork of activeuuid https://github.com/inbeom/activeuuid If you're interested, use my fork instead. Thanks! |
Open
@inbeom Will you be releasing your fork to ruby gems? |
@inbeom - I can give you access to the rubygem if you'd like |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues resolved
Timing mismatch between AR connection adapter loading and monkey-patching
In Rails 5, monkey-patches loaded by
ActiveUUID::Patches.apply!
were not properly injected to connection adapters as original connection adapters are not loaded by the timeapply!
method is invoked.The connection adapters are loaded when connection spec is analyzed and resolved by
ActiveRecord::ConnectionAdapters::ConnectionSpecification::Resolver#spec
, which is invoked insideActiveRecord::Base#establish_connection
.I've added a workaround by performing the patches immediately after connections are established, using
Module#prepend
.Invalid serialization of UUID-type columns
Due to refactoring of column type metadata classes (the type class definitions are moved into ActiveModel), a new interface for value serialization is introduced.
I overrided the new
ActiveRecord::Type::UUID#serialize
method to serialize UUID values as desired.Deprecated
alias_method_chain
I replaced
alias_method_chain
withModule#prepend
where it can be done easily.