Sha256: 502e3c79eb9eaa9e29e7755e232c9f3e57108acf868ec61fb239a85e1989b712

Contents?: true

Size: 424 Bytes

Versions: 9

Compression:

Stored size: 424 Bytes

Contents

require 'active_support/concern'

module Georgia
  module Concerns
    module Treeable
      extend ActiveSupport::Concern

      included do

        has_ancestry orphan_strategy: :rootify
        attr_accessible :parent_id

      end

      module ClassMethods

        def update_tree(tree)
          tree.each do |id, attributes|
            update(id, attributes)
          end
        end

      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
georgia-0.7.8 app/models/georgia/concerns/treeable.rb
georgia-0.7.7 app/models/georgia/concerns/treeable.rb
georgia-0.7.6 app/models/georgia/concerns/treeable.rb
georgia-0.7.5 app/models/georgia/concerns/treeable.rb
georgia-0.7.4 app/models/georgia/concerns/treeable.rb
georgia-0.7.3 app/models/georgia/concerns/treeable.rb
georgia-0.7.2 app/models/georgia/concerns/treeable.rb
georgia-0.7.1 app/models/georgia/concerns/treeable.rb
georgia-0.7.0 app/models/georgia/concerns/treeable.rb