Skip to content
Snippets Groups Projects
Commit fa4258bc authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Merge branch 'master' into fix_search

parents e5277e5a 09921c84
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,8 @@ class CollectionSerializer < ActiveModel::Serializer
object.complained? current_user
end
attributes :id, :name, :owner, :created_at, :updated_at, :description, :privacy, :score, :likes_count, :liked, :reviewed, :complained, :review_average, :thumbnail
attributes :id, :name, :created_at, :updated_at, :description, :privacy, :score, :likes_count, :liked, :reviewed, :complained, :review_average, :thumbnail
belongs_to :owner
has_many :tags
has_many :subjects
has_many :educational_stages
......
class AddNicknameToUser < ActiveRecord::Migration[5.0]
def change
add_column :users, :nickname, :string
end
end
require 'fileutils'
namespace :attachment_maintaining_service do
desc 'Removing 10 attachments'
task remove_attachments: :environment do
m = sort_directories.first(10)
m.each do |mm|
#puts (mm)
FileUtils.rm_r(mm)
end
end
def sort_directories
files_sorted_by_time = Dir[dir_path].sort_by{ |f| File.atime(f) }
files_sorted_by_time
end
private
def dir_path
c = Rails.root.join('public','attachments','*').to_s
c
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment