Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added a uuid type in mysql abstract adapter.
Let use conn.add_column and conn.change_column in migration.
- Loading branch information
Showing
4 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'activeuuid' | ||
|
||
module ActiveUUID::SpecSupport | ||
class SpecForAdapter | ||
def initialize | ||
@specs = {} | ||
end | ||
|
||
[:sqlite, :mysql2, :postgres].each do |name| | ||
send :define_method, name do |&block| | ||
@specs[name] = block | ||
end | ||
end | ||
|
||
def run(connection) | ||
name = connection.adapter_name.downcase.to_sym | ||
@specs[name].call() if(@specs.include? name) | ||
end | ||
end | ||
end |