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

Introduce support for the Attributes API typing #1159

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Commits on Dec 14, 2018

  1. Introduce support for the Attributes API typing

    The column type itself is only a uuid in certain database
    implementations like PostgreSQL
    
    MySQL uuids are supportable using the Rails 5 Attributes API and
    registering a new :uuid type. The column type is not a :uuid, but the
    registered attribute type is a :uuid
    
    e.g.
    
    module ActiveRecord
      module Type
        class Uuid < ActiveRecord::Type::Binary
          def type
            :uuid
          end
    
          ...
        end
      end
    end
    
    ActiveRecord::Type.register(:uuid, ActiveRecord::Type::Uuid, adapter: :mysql2)
    
    class Model < ApplicationRecord
      attribute :id, :uuid
    end
    
    Model.attribute_types[:id].type # => :uuid
    bsimpson committed Dec 14, 2018
    Configuration menu
    Copy the full SHA
    674e986 View commit details
    Browse the repository at this point in the history
  2. Update indentation

    bsimpson committed Dec 14, 2018
    Configuration menu
    Copy the full SHA
    4fefa00 View commit details
    Browse the repository at this point in the history

Commits on Dec 17, 2018

  1. Conditionalize uuid registration

    Linting changes
    bsimpson committed Dec 17, 2018
    Configuration menu
    Copy the full SHA
    c4d751c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c35b6d7 View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2018

  1. Configuration menu
    Copy the full SHA
    d14883f View commit details
    Browse the repository at this point in the history
  2. Linting fixes

    bsimpson committed Dec 18, 2018
    Configuration menu
    Copy the full SHA
    81d8d3a View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2018

  1. Configuration menu
    Copy the full SHA
    c95f26c View commit details
    Browse the repository at this point in the history