Module: ActiveScaffold

Defined in:
lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/bridge.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/finder.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/search.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/constraints.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb,
lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/advanced_finder.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/form_ui.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/list_ui.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/attribute_params.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/id_helpers.rb,
lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/helpers/view_helpers.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/view_helpers.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/number_helpers.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/country_helpers.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/controller_helpers.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/pagination_helpers.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/association_helpers.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/form_column_helpers.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/list_column_helpers.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/show_column_helpers.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/search_column_helpers.rb,
lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/calendar_date_select/lib/as_cds_bridge.rb,
lib/six-updater-web/vendor/plugins/activescaffold_advanced_search/lib/helpers/advanced_search_helpers.rb

Defined Under Namespace

Modules: Actions, AdvancedFinder, AttributeParams, CalendarDateSelectBridge, ClassMethods, Config, Configurable, Constraints, DataStructures, Finder, Helpers, Search, TinyMceBridge Classes: ActionNotAllowed, Bridge, ControllerNotFound, DependencyFailure, MalformedConstraint, RecordNotAllowed, ReverseAssociationRequired

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.bridge(name, &block) ⇒ Object



2
3
4
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/bridges/bridge.rb', line 2

def self.bridge(name, &block)
  ActiveScaffold::Bridge.new(name, &block)
end

.included(base) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold.rb', line 9

def self.included(base)
  base.extend(ClassMethods)
  base.module_eval do
    # TODO: these should be in actions/core
    before_filter :handle_user_settings
  end
end

.set_defaults(&block) ⇒ Object



17
18
19
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold.rb', line 17

def self.set_defaults(&block)
  ActiveScaffold::Config::Core.configure &block
end

Instance Method Details

#active_scaffold_configObject



21
22
23
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold.rb', line 21

def active_scaffold_config
  self.class.active_scaffold_config
end

#active_scaffold_config_for(klass) ⇒ Object



25
26
27
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold.rb', line 25

def active_scaffold_config_for(klass)
  self.class.active_scaffold_config_for(klass)
end

#active_scaffold_session_storageObject



29
30
31
32
33
34
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold.rb', line 29

def active_scaffold_session_storage
  id = params[:eid] || params[:controller]
  session_index = "as:#{id}"
  session[session_index] ||= {}
  session[session_index]
end

#handle_user_settingsObject

at some point we need to pass the session and params into config. we’ll just take care of that before any particular action occurs by passing those hashes off to the UserSettings class of each action.



37
38
39
40
41
42
43
44
45
46
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold.rb', line 37

def 
  if self.class.uses_active_scaffold?
    active_scaffold_config.actions.each do |action_name|
      conf_instance = active_scaffold_config.send(action_name) rescue next
      next if conf_instance.class::UserSettings == ActiveScaffold::Config::Base::UserSettings # if it hasn't been extended, skip it
      active_scaffold_session_storage[action_name] ||= {}
      conf_instance.user = conf_instance.class::UserSettings.new(conf_instance, active_scaffold_session_storage[action_name], params)
    end
  end
end