Sha256: 1314ee55d903cc08dbe1187e5005ecd9e89d008d707bcb2448f97206ab6529d0

Contents?: true

Size: 770 Bytes

Versions: 20

Compression:

Stored size: 770 Bytes

Contents

module ActiveScaffold
  module DelayedSetup
    def self.included(base)
      base.extend ClassMethods
    end

    def process(*)
      self.class.config_active_scaffold_delayed
      super
    end

    module ClassMethods
      def active_scaffold(model_id = nil, &block)
        @active_scaffold_delayed = proc { super(model_id, &block) }
      end

      def config_active_scaffold_delayed
        return unless @active_scaffold_delayed
        @_prefixes = nil # clean prefixes in case is already cached, so our local_prefixes override is picked up
        block, @active_scaffold_delayed = @active_scaffold_delayed, nil
        block.call
      end

      def active_scaffold_config
        config_active_scaffold_delayed
        super
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
active_scaffold-3.5.5 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.5.4 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.5.3 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.5.2 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.5.1 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.5.0 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.43 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.42 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.41.1 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.41 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.40 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.39 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.38 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.37 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.36 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.35 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.34 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.33 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.32 lib/active_scaffold/delayed_setup.rb
active_scaffold-3.4.31 lib/active_scaffold/delayed_setup.rb