Sha256: 920ad8a4815c54cd6892e730e724ddb6552779367b96edc185348727acb4023b
Contents?: true
Size: 686 Bytes
Versions: 96
Compression:
Stored size: 686 Bytes
Contents
require 'active_scaffold/config/core' module ActiveScaffold::Config class Core < Base def initialize_with_checkbox(model_id) initialize_without_checkbox(model_id) checkbox_fields = self.model.columns.collect{|c| c.name.to_sym if [:boolean].include?(c.type) }.compact # check to see if file column was used on the model return if checkbox_fields.empty? # automatically set the forum_ui to a file column checkbox_fields.each{|field| self.columns[field].form_ui = :checkbox } end alias_method_chain :initialize, :checkbox unless self.instance_methods.include?("initialize_without_checkbox") end end
Version data entries
96 entries across 96 versions & 1 rubygems