enum_column 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/enum_column/schema_statements.rb +4 -4
- data/lib/enum_column/version.rb +1 -1
- metadata +5 -5
@@ -6,17 +6,17 @@ module ActiveRecord
|
|
6
6
|
# Add enumeration support for schema statement creation. This
|
7
7
|
# will have to be adapted for every adapter if the type requires
|
8
8
|
# anything by a list of allowed values. The overrides the standard
|
9
|
-
# type_to_sql method and chains back to the default. This could
|
9
|
+
# type_to_sql method and chains back to the default. This could
|
10
10
|
# be done on a per adapter basis, but is generalized here.
|
11
11
|
#
|
12
12
|
# will generate enum('a', 'b', 'c') for :limit => [:a, :b, :c]
|
13
13
|
def type_to_sql(type, limit = nil, precision = nil, scale = nil) #:nodoc:
|
14
14
|
if type == :enum
|
15
15
|
native = native_database_types[type]
|
16
|
-
column_type_sql = native.
|
17
|
-
|
16
|
+
column_type_sql = !native.blank? && native[:name] ? native[:name] : 'enum'
|
17
|
+
|
18
18
|
column_type_sql << "(#{limit.map { |v| quote(v) }.join(',')})"
|
19
|
-
column_type_sql
|
19
|
+
column_type_sql
|
20
20
|
else
|
21
21
|
# Edge rails fallback for Rails 1.1.6. We can remove the
|
22
22
|
# rescue once everyone has upgraded to 1.2.
|
data/lib/enum_column/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enum_column
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stephan Kaag
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-03-
|
19
|
+
date: 2011-03-24 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
requirements: []
|
77
77
|
|
78
78
|
rubyforge_project:
|
79
|
-
rubygems_version: 1.
|
79
|
+
rubygems_version: 1.6.2
|
80
80
|
signing_key:
|
81
81
|
specification_version: 3
|
82
82
|
summary: Ruby on Rails Enumerated Column Constraints
|