Skip to content

Commit

Permalink
[#7] Removes to_csv method from User model.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabionl committed Oct 31, 2021
1 parent 2896999 commit e06bb62
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ class User < ApplicationRecord
# user&.authenticate(password)
# end

def self.to_csv
attributes = %w[id name email password_digest created_at updated_at admin activation_email_sent phone_number
verified]

CSV.generate(headers: true) do |csv|
csv << attributes

all.find_each do |user|
csv << attributes.map { |attr| user.send(attr) }
end
end
end
# def self.to_csv
# attributes = %w[id name email password_digest created_at updated_at admin activation_email_sent phone_number
# verified]
#
# CSV.generate(headers: true) do |csv|
# csv << attributes
#
# all.find_each do |user|
# csv << attributes.map { |attr| user.send(attr) }
# end
# end
# end

def manages
return Facility.all if super_admin?
Expand Down

0 comments on commit e06bb62

Please sign in to comment.