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

Version Path
six-updater-web-0.24.15 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.14 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.13 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.12 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.11 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.10 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.9 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.8 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.7 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.6 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.5 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.4 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.3 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.2 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.1 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.24.0 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.23.7 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.23.6 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.23.5 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.23.4 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb