Module: ActiveScaffold::Bridges

Defined in:
lib/active_scaffold/bridges.rb,
lib/active_scaffold/bridges/date_picker.rb,
lib/active_scaffold/bridges/date_picker/helper.rb,
lib/active_scaffold/bridges/shared/date_bridge.rb,
lib/active_scaffold/bridges/cancan/cancan_bridge.rb,
lib/active_scaffold/bridges/ancestry/ancestry_bridge.rb,
lib/active_scaffold/bridges/bitfields/bitfields_bridge.rb,
lib/active_scaffold/bridges/paperclip/paperclip_bridge.rb,
lib/active_scaffold/bridges/dragonfly/dragonfly_bridge.rb,
lib/active_scaffold/bridges/carrierwave/carrierwave_bridge.rb,
lib/active_scaffold/bridges/file_column/file_column_helpers.rb,
lib/active_scaffold/bridges/paperclip/paperclip_bridge_helpers.rb,
lib/active_scaffold/bridges/calendar_date_select/as_cds_bridge.rb,
lib/active_scaffold/bridges/dragonfly/dragonfly_bridge_helpers.rb,
lib/active_scaffold/bridges/country_helper/country_helper_bridge.rb,
lib/active_scaffold/bridges/carrierwave/carrierwave_bridge_helpers.rb

Defined Under Namespace

Modules: Shared Classes: Ancestry, Bitfields, CalendarDateSelect, Cancan, Carrierwave, Chosen, CountryHelper, DatePicker, Dragonfly, FileColumn, Paperclip, RecordSelect, SemanticAttributes, TinyMce

Class Method Summary collapse

Class Method Details

.all_javascriptsObject



50
51
52
53
54
55
# File 'lib/active_scaffold/bridges.rb', line 50

def self.all_javascripts
  self.bridges.keys.collect do |bridge_name|
    bridge = self[bridge_name]
    bridge.javascripts if bridge and bridge.install?
  end.compact.flatten
end

.all_stylesheetsObject



43
44
45
46
47
48
# File 'lib/active_scaffold/bridges.rb', line 43

def self.all_stylesheets
  self.bridges.keys.collect do |bridge_name|
    bridge = self[bridge_name]
    bridge.stylesheets if bridge and bridge.install?
  end.compact.flatten
end

.load(bridge_name) ⇒ Object Also known as: []



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/active_scaffold/bridges.rb', line 17

def self.load(bridge_name)
  bridge = self.bridges[bridge_name.to_sym]
  if bridge.is_a? String
    if ActiveScaffold.exclude_bridges.exclude? bridge_name.to_sym
      bridge = bridge.camelize.constantize
      self.bridges[bridge_name.to_sym] = bridge
    else
      self.bridges.delete bridge_name
      bridge = nil
    end
  end
  bridge
end

.register(file) ⇒ Object



12
13
14
15
# File 'lib/active_scaffold/bridges.rb', line 12

def self.register(file)
  match = file.match(/(active_scaffold\/bridges\/(.*))\.rb\Z/)
  self.bridges[match[2].to_sym] = match[1] if match
end

.run_allObject



34
35
36
37
38
39
40
41
# File 'lib/active_scaffold/bridges.rb', line 34

def self.run_all
  return false if self.bridges_run
  self.bridges.keys.each do |bridge_name|
    bridge = self[bridge_name]
    bridge.run if bridge
  end
  self.bridges_run = true
end