sequel-crushyform 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -359,6 +359,7 @@ CHANGE LOG
359
359
  0.0.8 Fix bug with apostrophe in text fields
360
360
  0.1.0 Add `:select` type and make `:parent` type overridable through `set_schema`
361
361
  0.1.1 Use strftime fordate/time (do not know why I did not !!!)
362
+ 0.1.2 Monkey patch, just prevent to have text areas instead of text fields when using PostgreSQL
362
363
 
363
364
  COPYRIGHT
364
365
  =========
@@ -1,7 +1,7 @@
1
1
  module ::Sequel::Plugins::Crushyform
2
2
 
3
3
  module ClassMethods
4
- def crushyform_version; [0,1,1]; end
4
+ def crushyform_version; [0,1,2]; end
5
5
  # Schema
6
6
  def crushyform_schema
7
7
  @crushyform_schema ||= default_crushyform_schema
@@ -9,7 +9,7 @@ module ::Sequel::Plugins::Crushyform
9
9
  def default_crushyform_schema
10
10
  out = {}
11
11
  db_schema.each do |k,v|
12
- out[k] = if v[:db_type]=='text'
12
+ out[k] = if [:sqlite,:mysql].include?(@db.database_type) && v[:db_type]=='text'
13
13
  {:type=>:text}
14
14
  else
15
15
  {:type=>v[:type]}
@@ -101,7 +101,7 @@ module ::Sequel::Plugins::Crushyform
101
101
  end
102
102
  def reset_dropdown_cache; @dropdown_cache = nil; end
103
103
  # Generic column names for label
104
- LABEL_COLUMNS = [:title, :label, :fullname, :full_name, :surname, :lastname, :last_name, :name, :firstname, :first_name, :caption, :reference, :file_name, :body]
104
+ LABEL_COLUMNS = [:title, :label, :fullname, :full_name, :surname, :lastname, :last_name, :name, :firstname, :first_name, :login, :caption, :reference, :file_name, :body]
105
105
  # Column used as a label
106
106
  def label_column; @label_column ||= LABEL_COLUMNS.find{|c|columns.include?(c)}; end
107
107
  def label_column=(n); @label_column=n; end
@@ -159,4 +159,4 @@ module ::Sequel::Plugins::Crushyform
159
159
  def after_destroy; model.reset_dropdown_cache; super; end
160
160
  end
161
161
 
162
- end
162
+ end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'sequel-crushyform'
3
- s.version = "0.1.1"
3
+ s.version = "0.1.2"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.summary = "A Sequel plugin that helps building forms"
6
6
  s.description = "A Sequel plugin that helps building forms. It basically does them for you so that you can forget about the boring part. The kind of thing which is good to have in your toolbox for building a CMS."
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-crushyform
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease:
4
+ hash: 31
5
+ prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mickael Riga
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-23 00:00:00 +01:00
18
+ date: 2011-09-15 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  requirements: []
64
64
 
65
65
  rubyforge_project:
66
- rubygems_version: 1.4.2
66
+ rubygems_version: 1.3.7
67
67
  signing_key:
68
68
  specification_version: 3
69
69
  summary: A Sequel plugin that helps building forms