has_custom_fields 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{has_custom_fields}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{kylejginavan}]
@@ -22,6 +22,6 @@
22
22
  <key>showFileHierarchyDrawer</key>
23
23
  <true/>
24
24
  <key>windowFrame</key>
25
- <string>{{2143, 139}, {1203, 1047}}</string>
25
+ <string>{{2128, 135}, {1203, 1047}}</string>
26
26
  </dict>
27
27
  </plist>
@@ -4,7 +4,7 @@ module CustomFields
4
4
  serialize :select_options
5
5
  validates_presence_of :name,
6
6
  :message => 'Please specify the field name.'
7
- validates_presence_of :select_options_csv,
7
+ validates_presence_of :select_options_data,
8
8
  :if => "self.style.to_sym == :select",
9
9
  :message => "You must enter options for the selection, separated by commas."
10
10
 
@@ -16,11 +16,11 @@ module CustomFields
16
16
  FOO
17
17
  end
18
18
 
19
- def select_options_csv
19
+ def select_options_data
20
20
  (self.select_options || []).join(",")
21
21
  end
22
22
 
23
- def select_options_csv=(csv)
23
+ def select_options_data=(csv)
24
24
  self.select_options = csv.split(",").collect{|f| f.strip}
25
25
  end
26
26
 
@@ -221,8 +221,8 @@ module ActiveRecord # :nodoc:
221
221
  ActiveRecord::Base.transaction do
222
222
 
223
223
  self.connection.create_table(options[:fields_table_name], options) do |t|
224
- t.string options[:name_field], :null => false
225
- t.string :style, :null => false
224
+ t.string options[:name_field], :null => false, :limit => 63
225
+ t.string :style, :null => false, :limit => 15
226
226
  t.string :select_options
227
227
  scope_fkeys.each do |s|
228
228
  t.integer s
@@ -253,7 +253,6 @@ module ActiveRecord # :nodoc:
253
253
  t.integer options[:foreign_key], :null => false
254
254
  t.integer options[:fields_table_name].foreign_key, :null => false
255
255
  t.string options[:value_field], :null => false
256
-
257
256
  t.timestamps
258
257
  end
259
258
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: has_custom_fields
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - kylejginavan