activerecord-mysql-unsigned 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a191990d328533d3c11ad7364dfe8bb039885b20
|
4
|
+
data.tar.gz: f0b1b0baafd8b7c53a4cf9dc0434c98277f0687a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbf0d9f8d490528fa43316aed3a46c44711ce33ca881c86be5f4c8cd23fc500d548be9860640311f5f5f9aadf51c8d27557c1ea5df750f3f0649110d295cd8e0
|
7
|
+
data.tar.gz: 2c74230976b513f0c9fe11b318c6cc332db888ab07a79f54b818e46779b910df81cf03a3bfccbc25edd651283ca763820e147ba3bc52c9413a83e19b4e144411
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
# Activerecord::Mysql::Unsigned
|
1
|
+
# Activerecord::Mysql::Unsigned
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/waka/activerecord-mysql-unsigned.png?branch=master)](https://travis-ci.org/waka/activerecord-mysql-unsigned) [![Gem Version](https://badge.fury.io/rb/activerecord-mysql-unsigned.svg)](http://badge.fury.io/rb/activerecord-mysql-unsigned)
|
2
4
|
|
3
5
|
Add unsigned option to integer type for ActiveRecord's MySQL2 adapter.
|
4
6
|
|
@@ -1,11 +1,12 @@
|
|
1
|
+
require 'forwardable'
|
1
2
|
require 'active_record/connection_adapters/abstract_mysql_adapter'
|
2
3
|
|
3
4
|
module ActiveRecord
|
4
5
|
module ConnectionAdapters
|
5
6
|
class AbstractMysqlAdapter < AbstractAdapter
|
6
|
-
|
7
|
-
class SchemaCreation < AbstractAdapter::SchemaCreation
|
8
7
|
|
8
|
+
class SchemaCreation < AbstractAdapter::SchemaCreation
|
9
|
+
extend Forwardable
|
9
10
|
def visit_AddColumn(o)
|
10
11
|
sql_type = type_to_sql(o.type.to_sym, o.limit, o.precision, o.scale, o.unsigned)
|
11
12
|
sql = "ADD #{quote_column_name(o.name)} #{sql_type}"
|
@@ -20,7 +21,7 @@ module ActiveRecord
|
|
20
21
|
options = o.options
|
21
22
|
sql_type = type_to_sql(o.type, options[:limit], options[:precision], options[:scale], options[:unsigned])
|
22
23
|
change_column_sql = "CHANGE #{quote_column_name(column.name)} #{quote_column_name(options[:name])} #{sql_type}"
|
23
|
-
add_column_options!(change_column_sql, options)
|
24
|
+
add_column_options!(change_column_sql, options.merge(column: column))
|
24
25
|
add_column_position!(change_column_sql, options)
|
25
26
|
end
|
26
27
|
|
@@ -31,9 +32,7 @@ module ActiveRecord
|
|
31
32
|
column_sql
|
32
33
|
end
|
33
34
|
|
34
|
-
|
35
|
-
@conn.type_to_sql type.to_sym, limit, precision, scale, unsigned
|
36
|
-
end
|
35
|
+
def_delegator :@conn, :type_to_sql, :type_to_sql
|
37
36
|
end
|
38
37
|
|
39
38
|
NATIVE_DATABASE_TYPES.merge!(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-mysql-unsigned
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yo_waka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|