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: 0701a7029950db4d1a05d8de74aaadf39b035368
4
- data.tar.gz: 737d28712950d180796320e100cbd87b24c050cc
3
+ metadata.gz: a191990d328533d3c11ad7364dfe8bb039885b20
4
+ data.tar.gz: f0b1b0baafd8b7c53a4cf9dc0434c98277f0687a
5
5
  SHA512:
6
- metadata.gz: 8d735efbeba0b96dad50e43c07e98fe9910b4f1d18127a2341b53abf1d7daa5ad75936def02ef086f60d12101c396251338fbf76c7f00a76109f22147a99ffe3
7
- data.tar.gz: 1e2d852d8f0f616c6e0c71d36a6465ef543591ba404c50d0a1bc63e5fc2280e7988141e1f46c91622357abf893aeea2295a2ca3169cf096687edd44aaddc1c56
6
+ metadata.gz: dbf0d9f8d490528fa43316aed3a46c44711ce33ca881c86be5f4c8cd23fc500d548be9860640311f5f5f9aadf51c8d27557c1ea5df750f3f0649110d295cd8e0
7
+ data.tar.gz: 2c74230976b513f0c9fe11b318c6cc332db888ab07a79f54b818e46779b910df81cf03a3bfccbc25edd651283ca763820e147ba3bc52c9413a83e19b4e144411
@@ -1,3 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
+ - 2.1
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # Activerecord::Mysql::Unsigned [![Build Status](https://travis-ci.org/waka/activerecord-mysql-unsigned.png?branch=master)](https://travis-ci.org/waka/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
- def type_to_sql(type, limit, precision, scale, unsigned)
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!(
@@ -1,7 +1,7 @@
1
1
  module ActiveRecord
2
2
  module Mysql
3
3
  module Unsigned
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
6
6
  end
7
7
  end
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.2
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-07 00:00:00.000000000 Z
11
+ date: 2014-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler