Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mock "get size" feature from share plugin on dev environment #227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/share.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ def before_save_hook
return unless self.path_changed?
return if self.path.nil? or self.path.blank?
user = User.admins.first.login
system("mkdir -p \"#{self.path}\"") if Rails.env == 'development'
c = Command.new
c.submit("rmdir \"#{self.path_was}\"") unless self.path_was.blank?
c.submit("mkdir -p \"#{self.path}\"")
Expand Down
7 changes: 4 additions & 3 deletions plugins/020-shares/app/controllers/shares_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def index
def create
sleep 2 if development?
@share = Share.new(params_create_share)
@share.path = "./.hda" + @share.path if development?
@share.save
get_shares unless @share.errors.any?
end
Expand Down Expand Up @@ -91,14 +92,14 @@ def toggle_guest_writeable
render :json => { :status => @saved ? :ok : :not_acceptable }
end

def update_tags
def update_tags
sleep 2 if development?
@saved = @share.update_tags!(params_update_tags_path)
end

def update_path
sleep 2 if development?
@saved = @share.update_tags!(params_update_tags_path)
@saved = @share.update_tags!(params_update_tags_path)
render :json => { :status => @saved ? :ok : :not_acceptable }
end

Expand Down Expand Up @@ -175,7 +176,7 @@ def params_update_tags_path
unless params[:share].blank?
params.require(:share).permit([:path,:tags])
else
params.permit([:name])
params.permit([:name])
end
end

Expand Down