fnando / ar-uuid Goto Github PK
View Code? Open in Web Editor NEWOverride migration methods to support UUID columns without having to be explicit about it.
License: MIT License
Override migration methods to support UUID columns without having to be explicit about it.
License: MIT License
If you use ar-uuid to handle the uuid field typing for creating models and foreign key associations, a side effect is it breaks
Rails.application.config.active_record.belongs_to_required_by_default = true
In other words, for some reason the new Rails 5 default belongs_to validation (that ensures the child record contains the parent's id) is no longer run when an instance of the child is created or saved.
On the other hand, if you add the uuid typing manually instead of using the gem, the default belongs_to validation runs normally.
Unfortunately, as of Rails 5.0.1, which allows changing the default primary key to uuid without use of the ar-uuid gem, does not handle associations.
In our case we turn off the new Rails 5 belongs_to default validation, but I wanted to document this side-effect of the ar-uuid gem in case someone else is using it in Rails 5.
The dependency on ruby 2.1.0 or greater is unfortunate since 2.1 and 2.2 appear to be plagued with memory issues when running on Heroku.
For those of us still using Ruby 2.0 due to those memory issues, am I correct the gem is only used/needed in development, and only when creating migrations, and therefore it might be possible to temporarily upgrade ruby just when doing migrations but not when running the app? Eg, that there is no production behavior implemented in the gem?
I am hoping the following process might work (assuming the development machine uses rbenmv to manage both Ruby 2.0 and 2.1):
What license is this library made available under? Don't see one in the repository.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.