Sha256: f9fad3ceda0a5ad429a47c7e607c701022243707e3e9a4e614a7bc14f2726c91

Contents?: true

Size: 537 Bytes

Versions: 15

Compression:

Stored size: 537 Bytes

Contents

module ActiveScaffoldSortable
  module Core
    def self.included(base)
      base.alias_method_chain :initialize, :sortable
    end

    def initialize_with_sortable(model_id)
      initialize_without_sortable(model_id)
      # seems some rubies are returning strings in instance_methods and other symbols...
      if !(model.instance_methods & ['acts_as_list_class', :acts_as_list_class, 'nested_set_scope', :nested_set_scope]).empty?
        self.actions << :sortable
        self.sortable # force to load
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
active_scaffold_sortable-3.3.0 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.13 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.12 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.11 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.10 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.9 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.8 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.7 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.6 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.5 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.4 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.3 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.2 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.1 lib/active_scaffold_sortable/core.rb
active_scaffold_sortable-3.2.0 lib/active_scaffold_sortable/core.rb