lib/ab_admin/config/base.rb in ab_admin-0.8.2 vs lib/ab_admin/config/base.rb in ab_admin-0.8.3
- old
+ new
@@ -16,14 +16,13 @@
@fields << Field.new(name, options, &block)
end
def self.default_for_model(model, options={})
new.tap do |builder|
- builder.field(:id) unless options[:skip].try(:include?, :id)
model.column_names.each do |column|
column_name = column.to_sym
- next if options[:skip].try(:include?, column_name)
+ next if column_name == :id || options[:skip].try(:include?, column_name)
builder.field(column_name)
end
end
end
end
@@ -50,10 +49,10 @@
class Form < BaseBuilder
self.partial_name = 'form'
def group(name=nil, options={}, &block)
- options[:title] = name || :base
+ options[:title] = name
@fields << FieldGroup.new(options, &block)
end
def locale_tabs(options={}, &block)
@fields << FieldGroup.new(options.update(localized: true), &block)