sequel-crushyform 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -303,6 +303,7 @@ CHANGE LOG
303
303
  0.0.4 Fix type `:none`
304
304
  0.0.5 Crushyform method guesses the enctype
305
305
  0.0.6 Human name for classes and label for new records
306
+ 0.0.7 Fix `Model#to_label`
306
307
 
307
308
  COPYRIGHT
308
309
  =========
@@ -1,7 +1,7 @@
1
1
  module ::Sequel::Plugins::Crushyform
2
2
 
3
3
  module ClassMethods
4
- def crushyform_version; [0,0,6]; end
4
+ def crushyform_version; [0,0,7]; end
5
5
  # Schema
6
6
  def crushyform_schema
7
7
  @crushyform_schema ||= default_crushyform_schema
@@ -132,7 +132,7 @@ module ::Sequel::Plugins::Crushyform
132
132
  # Which means there could be a colision.
133
133
  def crushyid_for(col); "%s-%s-%s" % [id||'new',self.class.name,col]; end
134
134
  # Used to determine a humanly readable representation of the entry on one line of text
135
- def to_label; model.label_column.nil? ? [self.new? ? 'New' : nil, model.human_name, id].compact!.join(' ') : self.__send__(model.label_column).to_s.tr("\n\r", ' '); end
135
+ def to_label; model.label_column.nil?||self.new? ? [self.new? ? 'New' : nil, model.human_name, id].compact!.join(' ') : self.__send__(model.label_column).to_s.tr("\n\r", ' '); end
136
136
  # Provide a thumbnail for the column
137
137
  def to_thumb(c)
138
138
  current = self.__send__(c)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'sequel-crushyform'
3
- s.version = "0.0.6"
3
+ s.version = "0.0.7"
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."
@@ -187,7 +187,7 @@ describe 'Crushyform miscellaneous helpers' do
187
187
 
188
188
  should 'have a label based on Model::label_column' do
189
189
  Author.first.to_label.should=='Bradbury'
190
- Author.new(:surname=>'Brautigan').to_label.should=='Brautigan'
190
+ Author.new.to_label.should=='New Author'
191
191
  end
192
192
 
193
193
  should 'Have a fallback label when label_column is nil' do
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mickael Riga