Sha256: 8f003d07dc48e5486283de4108b8576eef9429ff834050c85a002da8b468cea2

Contents?: true

Size: 495 Bytes

Versions: 23

Compression:

Stored size: 495 Bytes

Contents

namespace :fix do
  desc 'Fix acts as list positions if they ever get out of sync for a model'
  task :acts_as_list_positions => :environment do
    raise ArgumentError, 'You must specify model with MODEL environment variable' if ENV['MODEL'].nil?

    model_class     = ENV['MODEL'].camelize.constantize
    scope_name      = ENV['SCOPE'].try(:to_sym)
    position_column = ENV['POSITION'].try(:to_sym)

    PositionInitializer.positionalize(model_class, scope_name, position_column)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rails_core_extensions-0.15.0 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.14.0 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.13.2 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.13.1 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.13.0 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.12.0 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.11.3 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.11.2 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.11.1 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.11.0.beta.11 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.10.0 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.9.0 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.8.0 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.7.1 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.7.0 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.6.1 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.6.0 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.4.0 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.3.0 lib/rails_core_extensions/tasks/position_initializer.rake
rails_core_extensions-0.2.0 lib/rails_core_extensions/tasks/position_initializer.rake