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.17.2 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.17.1 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.17.0 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.16.3 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.16.2 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.16.0 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.15.4 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.15.3 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.15.2 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.15.1 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.14.12 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.14.10 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.14.9 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.14.8 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.14.7 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.14.6 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.14.5 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.14.4 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.14.3 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb
six-updater-web-0.14.2 lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb