enum_column 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.present? && native[:name] ? native[:name] : 'enum'
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.
@@ -1,3 +1,3 @@
1
1
  module EnumColumn
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
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-03 00:00:00 +01:00
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.5.0
79
+ rubygems_version: 1.6.2
80
80
  signing_key:
81
81
  specification_version: 3
82
82
  summary: Ruby on Rails Enumerated Column Constraints