Skip to content
Merged
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
2 changes: 0 additions & 2 deletions BrainPortal/app/controllers/application_controller.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ def check_password_reset #:nodoc:
#
# "User: tsmith from example.com (256.0.0.9) using FireChrome 99.9"
def log_user_info #:nodoc:
reqenv = request.env || {}

# Short username for the message
login = current_user ? current_user.login : "(none)"

Expand Down
3 changes: 0 additions & 3 deletions BrainPortal/app/controllers/bourreaux_controller.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,6 @@ def rr_disk_usage

date_filtering["relative_from"] ||= 50.years.to_i.to_s
date_filtering["relative_to"] ||= 1.week.to_i.to_s
accessed_after = date_filtering["relative_from"].to_i.seconds.ago
accessed_before = date_filtering["relative_to"].to_i.seconds.ago

# Used only relative value for determine_date_range_start_end --> harcode the 4 first values.
(accessed_after,accessed_before) = determine_date_range_start_end(false , false, Time.now, Time.now , date_filtering["relative_from"], date_filtering["relative_to"])

Expand Down
1 change: 0 additions & 1 deletion BrainPortal/app/controllers/noc_controller.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ def gather_info(since_when) #:nodoc:

# Show IP address
def fetch_ip_address
reqenv = request.env || {}
@ip_address ||= cbrain_request_remote_ip rescue 'UnknownIP'
end

Expand Down
4 changes: 2 additions & 2 deletions BrainPortal/app/controllers/tools_controller.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def tool_config_select #:nodoc:
@bourreaux = Bourreau.find_all_accessible_by_user(current_user).where( :id => bourreau_ids)
# All accessible tc for this tool on accessible bourreaux
bourreaux_ids = @bourreaux.map(&:id)
@tool_configs = ToolConfig.find_all_accessible_by_user(current_user).where(:tool_id => tool_id, :bourreau_id => bourreau_ids)
@tool_configs = ToolConfig.find_all_accessible_by_user(current_user).where(:tool_id => tool_id, :bourreau_id => bourreaux_ids)
# Reduce list of bourreaux, bourreaux need at least one config available
bourreaux_ids = @tool_configs.map(&:bourreau_id)
@bourreaux = @bourreaux.where(:id => bourreaux_ids).all
Expand All @@ -70,7 +70,7 @@ def tool_config_select #:nodoc:
selected_by_default = current_user.meta["pref_bourreau_id"]
@tool_config = @tool_configs.where(:bourreau_id => selected_by_default).last if (
bourreaux_ids.include?(selected_by_default) &&
@bourreaux.detect? { |b| b.id == selected_by_default && b.online? }
@bourreaux.any? { |b| b.id == selected_by_default && b.online? }
)

respond_to do |format|
Expand Down
2 changes: 1 addition & 1 deletion BrainPortal/app/controllers/userfiles_controller.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ def extract_from_archive(archive_file_name, file_type = nil, attributes = {}) #:
u.name = file_name
if u.save
u.cache_copy_from_local_file("#{workdir}/#{file_name}")
u.size = File.size(file_name)
u.size = File.size("#{workdir}/#{file_name}")
u.save
else
status = :failed
Expand Down
2 changes: 1 addition & 1 deletion BrainPortal/app/models/custom_filter.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def scope_date(scope)
relative_to = self.data_relative_to
table_name = self.target_filtered_table()

scope = add_time_condition_to_scope(scope, table_name,
add_time_condition_to_scope(scope, table_name,
mode_is_absolute_from, mode_is_absolute_to,
absolute_from, absolute_to,
relative_from, relative_to,
Expand Down
2 changes: 1 addition & 1 deletion BrainPortal/app/models/group.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def reassign_models_to_owner_group #:nodoc:
.select { |a| a.macro == :has_many }
.map { |a| a.name }
.reject { |a| a == :resource_usage } # we never modify the resource usage records
objlist = group_has_many_model_list.inject([]) { |list,modsym| list += self.send(modsym).to_a }
objlist = group_has_many_model_list.inject([]) { |list,modsym| list + self.send(modsym).to_a }
user_id_to_own_group_id = {} # to cache lookups
objlist.each do |obj|
next if obj.is_a?(ResourceUsage) # again, just to be sure
Expand Down
2 changes: 1 addition & 1 deletion BrainPortal/app/models/local_data_provider.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def impl_provider_list_all(user = nil, browse_path = nil) #:nodoc:
next unless stat # In case the file has been deleted

# Adjust type
type = type = stat.ftype.to_sym
type = stat.ftype.to_sym
type = :regular if type == :file
next if type != :regular && type != :directory && type != :symlink

Expand Down
4 changes: 2 additions & 2 deletions BrainPortal/app/models/message.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def self.send_internal_error_message(destination, header, exception, request_par
# will return
# 'abcde <a href="/my/path" class="action_link">name</a> def'
def render_attr(attr)
return sefl.attr unless %w[description variable_text header].include?(attr.to_s)
return self[attr] unless %w[description variable_text header].include?(attr.to_s)
if self.message_type == 'communication'
self[attr] || ''
else
Expand Down Expand Up @@ -330,7 +330,7 @@ def self.find_users_for_destination(destination, options={}) #:nodoc:

# Get a unique list of all users from all these groups
groups.compact!
allusers = groups.inject([]) { |flat,group| flat |= group.users }
allusers = groups.inject([]) { |flat,group| flat | group.users }
allusers.reject! { |u| u.account_locked? } if ! options[:include_locked_users]

# Select the list of users in list of groups; a special case is made
Expand Down
2 changes: 1 addition & 1 deletion BrainPortal/app/models/portal_task.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def clear #:nodoc:
end

def count #:nodoc:
inject(0) { |c| c += 1 }
inject(0) { |c, _| c + 1 }
end

def delete(paramspath) #:nodoc:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def set_size!
def merge_collections(userfiles)

# Check for collision
full_names = userfiles.inject([]){|list, file| list += file.list_files.map(&:name)}
full_names = userfiles.inject([]){|list, file| list + file.list_files.map(&:name)}

unless full_names.uniq.size == full_names.size
return :collision
Expand Down
2 changes: 1 addition & 1 deletion BrainPortal/cbrain_plugins/cbrain-plugins-base/userfiles/single_file/single_file.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def pretty_type #:nodoc:

# Forces calculation and setting of the size attribute.
def set_size!
self.size = self.list_files.inject(0){ |total, file_entry| total += file_entry.size }
self.size = self.list_files.inject(0){ |total, file_entry| total + file_entry.size }
self.save!

true
Expand Down
Loading