Skip to content

Instantly share code, notes, and snippets.

View gvalmon's full-sized avatar

Iskander Khaziev gvalmon

  • Epic Games
  • Montreal
View GitHub Profile
#1 ПЛОХО!
def UsersController
actions :index, :create
def update
end
def destroy
end
end
module HasBulkActions
extend ActiveSupport::Concern
module ClassMethods
def bulk_update(ids, attributes, params = {})
where("#{table_name}.id" => ids).update_all(attributes)
extract_bulk_events(params[:events], attributes).each do |event|
notify(event.to_sym)
end
end