Skip to content

Commit

Permalink
treesame commit of origin/stable/2016-06-25
Browse files Browse the repository at this point in the history
Treesame-Commit-Id: af7ab9a
  • Loading branch information
javawizard committed Jun 30, 2016
2 parents 112ad25 + af7ab9a commit be51c32
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 14 deletions.
4 changes: 3 additions & 1 deletion app/controllers/external_tools_controller.rb
Expand Up @@ -78,7 +78,9 @@ def index
end
@tools = ContextExternalTool.search_by_attribute(@tools, :name, params[:search_term])

@tools = @tools.placements(params[:placement]) if params[:placement]
@context.shard.activate do
@tools = @tools.placements(params[:placement]) if params[:placement]
end
if Canvas::Plugin.value_to_boolean(params[:selectable])
@tools = @tools.select{|t| t.selectable }
end
Expand Down
3 changes: 3 additions & 0 deletions app/models/attachment.rb
Expand Up @@ -1191,7 +1191,10 @@ def make_childless(preferred_child = nil)
s3object.copy_to(child.s3object)
end
else
old_content_type = self.content_type
Attachment.where(:id => self).update_all(:content_type => "invalid/invalid") # prevents find_existing_attachment_for_md5 from reattaching the child to the old root
child.uploaded_data = open
Attachment.where(:id => self).update_all(:content_type => old_content_type)
end
child.save!
Attachment.where(root_attachment_id: self).where.not(id: child).update_all(root_attachment_id: child)
Expand Down
8 changes: 6 additions & 2 deletions app/models/group_category.rb
Expand Up @@ -186,11 +186,15 @@ def has_heterogenous_group?
end

def group_for(user)
groups.active.where("EXISTS (?)", GroupMembership.active.where("group_id=groups.id").where(user_id: user)).first
shard.activate do
groups.active.where("EXISTS (?)", GroupMembership.active.where("group_id=groups.id").where(user_id: user)).take
end
end

def is_member?(user)
groups.active.where("EXISTS (?)", GroupMembership.active.where("group_id=groups.id").where(user_id: user)).any?
shard.activate do
groups.active.where("EXISTS (?)", GroupMembership.active.where("group_id=groups.id").where(user_id: user)).exists?
end
end

alias_method :destroy_permanently!, :destroy
Expand Down
2 changes: 1 addition & 1 deletion config/locales/locales.yml
Expand Up @@ -72,7 +72,7 @@ nb:
bigeasy_locale: nb_NO
nn:
locales:
nn: Norsk (Nynorsk)
nn: Norsk (Nynorsk) (crowd-sourced)
bigeasy_locale: nn_NO
fullcalendar_locale: nb
crowdsourced: true
Expand Down
123 changes: 114 additions & 9 deletions config/locales/mi.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions db/migrate/20160322204834_drop_zip_file_imports.rb
Expand Up @@ -19,6 +19,7 @@ def up
root.s3object.copy_to(child.s3object)
end
else
Attachment.where(:id => root).update_all(:content_type => "invalid/invalid") # prevents find_existing_attachment_for_md5 from reattaching the child to the old root
child.uploaded_data = root.open
end
child.save!
Expand Down
2 changes: 1 addition & 1 deletion lib/turnitin/outcome_response_processor.rb
Expand Up @@ -18,7 +18,7 @@ def process
update_turnitin_data!(submission, asset_string, status: 'pending', outcome_response: @outcomes_response_json)
self.send_later(:update_originality_data, submission, asset_string)
end
handle_asynchronously :process, max_attempts: 1, run_at: 1.minutes.from_now, priority: Delayed::LOW_PRIORITY
handle_asynchronously :process, max_attempts: 1, run_at: 5.minutes.from_now, priority: Delayed::LOW_PRIORITY

def resubmit(submission, asset_string)
self.send_later(:update_originality_data, submission, asset_string)
Expand Down

0 comments on commit be51c32

Please sign in to comment.