Fix typos, spelling in model comments

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/1085/head
Alex Coles 11 years ago
parent 6f6595ce38
commit d872d91d0d
  1. 4
      app/models/attachment.rb
  2. 4
      app/models/enumeration.rb
  3. 2
      app/models/member.rb
  4. 8
      app/models/permitted_params.rb
  5. 6
      app/models/project.rb
  6. 2
      app/models/project/copy.rb
  7. 2
      app/models/query.rb
  8. 4
      app/models/setting.rb
  9. 2
      app/models/system_user.rb
  10. 6
      app/models/user.rb
  11. 2
      app/models/version.rb
  12. 8
      app/models/work_package.rb

@ -65,7 +65,7 @@ class Attachment < ActiveRecord::Base
unless incoming_file.nil?
@temp_file = incoming_file
if @temp_file.size > 0
# Incomming_file might be a String if you parse an incomming mail having an attachment
# Incoming_file might be a String if you parse an incoming mail having an attachment
# It is a Mail::Part.decoded String then, which doesn't have the usual file methods.
if @temp_file.respond_to?(:original_filename)
self.filename = @temp_file.original_filename
@ -101,7 +101,7 @@ class Attachment < ActiveRecord::Base
logger.info("Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)")
md5 = Digest::MD5.new
File.open(diskfile, "wb") do |f|
# @temp_file might be a String if you parse an incomming mail having an attachment
# @temp_file might be a String if you parse an incoming mail having an attachment
# It is a Mail::Part.decoded String then, which doesn't have the usual file methods.
if @temp_file.is_a? String
f.write(@temp_file)

@ -73,7 +73,7 @@ class Enumeration < ActiveRecord::Base
end
# Destroys enumerations in a single transaction
# It ensures, that the transactions can be safely transfered to each
# It ensures, that the transactions can be safely transferred to each
# entry's parent
def self.bulk_destroy(entries)
sorted_entries = sort_by_ancestor_last(entries)
@ -105,7 +105,7 @@ class Enumeration < ActiveRecord::Base
self.objects_count != 0
end
# Is this enumeration overiding a system level enumeration?
# Is this enumeration overriding a system level enumeration?
def is_override?
!self.parent.nil?
end

@ -115,7 +115,7 @@ class Member < ActiveRecord::Base
Category.update_all "assigned_to_id = NULL", ["project_id = ? AND assigned_to_id = ?", project.id, user.id] if user
end
# Find or initilize a Member with an id, attributes, and for a Principal
# Find or initialize a Member with an id, attributes, and for a Principal
def self.edit_membership(id, new_attributes, principal=nil)
@membership = id.present? ? Member.find(id) : Member.new(:principal => principal)
# interface refactoring needed

@ -29,10 +29,10 @@
class PermittedParams < Struct.new(:params, :user)
# This class intends to provide a method for all params hashes comming from the
# This class intends to provide a method for all params hashes coming from the
# client and that are used for mass assignment.
#
# As such, please make it a deliberate decission to whitelist attributes.
# As such, please make it a deliberate decision to whitelist attributes.
#
# This implementation depends on the strong_parameters gem. For further
# information see here: https://github.com/rails/strong_parameters
@ -160,8 +160,8 @@ class PermittedParams < Struct.new(:params, :user)
end
def query
# there is a wierd bug in strong_parameters gem which makes the permit call
# on the sort_criteria pattern return the sort_criteria-hash contens AND
# there is a weird bug in strong_parameters gem which makes the permit call
# on the sort_criteria pattern return the sort_criteria-hash contents AND
# the sort_criteria hash itself (again with content) in the same hash.
# Here we try to circumvent this
p = params.require(:query).permit(*self.class.permitted_attributes[:query])

@ -43,7 +43,7 @@ class Project < ActiveRecord::Base
# reserved identifiers
RESERVED_IDENTIFIERS = %w( new level_list )
# Specific overidden Activities
# Specific overridden Activities
has_many :time_entry_activities
has_many :members, :include => [:user, :roles], :conditions => "#{User.table_name}.type='User' AND #{User.table_name}.status=#{User::STATUSES[:active]}"
has_many :possible_assignee_members,
@ -97,7 +97,7 @@ class Project < ActiveRecord::Base
validates_presence_of :name, :identifier
#TODO: we temporarily disable this validation because it leads to failed tests
#it implicitely assumes a db:seed-created standard type to be present and currently
#it implicitly assumes a db:seed-created standard type to be present and currently
#neither development nor deployment setups are prepared for this
#validates_presence_of :types
validates_uniqueness_of :identifier
@ -105,7 +105,7 @@ class Project < ActiveRecord::Base
validates_length_of :name, :maximum => 255
validates_length_of :homepage, :maximum => 255
validates_length_of :identifier, :in => 1..IDENTIFIER_MAX_LENGTH
# donwcase letters, digits, dashes but not digits only
# downcase letters, digits, dashes but not digits only
validates_format_of :identifier, :with => /\A(?!\d+$)[a-z0-9\-_]*\z/, :if => Proc.new { |p| p.identifier_changed? }
# reserved words
validates_exclusion_of :identifier, :in => RESERVED_IDENTIFIERS

@ -135,7 +135,7 @@ module Project::Copy
# Copies issues from +project+
def copy_work_packages(project)
# Stores the source issue id as a key and the copied issues as the
# value. Used to map the two togeather for issue relations.
# value. Used to map the two together for issue relations.
work_packages_map = {}
# Get issues sorted by root_id, lft so that parent issues

@ -323,7 +323,7 @@ class Query < ActiveRecord::Base
operator = filter.operator
# "me" value subsitution
# "me" value substitution
if @@user_filters.include? field
if values.delete("me")
if User.current.logged?

@ -98,12 +98,12 @@ class Setting < ActiveRecord::Base
# or set using Setting.some_setting_name = "some value"
src = <<-END_SRC
def self.#{name}
# when runnung too early, there is no settings table. do nothing
# when running too early, there is no settings table. do nothing
self[:#{name}] if settings_table_exists_yet?
end
def self.#{name}?
# when runnung too early, there is no settings table. do nothing
# when running too early, there is no settings table. do nothing
self[:#{name}].to_i > 0 if settings_table_exists_yet?
end

@ -40,7 +40,7 @@ class SystemUser < User
# The symptoms are, that saving User.system, which will happen when calling
# User.system.run_given, from inside a migration fails.
#
# The callback sends self.custom_values which leads to an eror
# The callback sends self.custom_values which leads to an error
# stating that no column "name", "default_value" or "possible_values"
# exists in the db. It is correct that such a field does not exist, as those are
# translated attributes so that they are to be found in custom_field_translations.

@ -145,7 +145,7 @@ class User < Principal
validates_uniqueness_of :login, :if => Proc.new { |user| !user.login.blank? }, :case_sensitive => false
validates_uniqueness_of :mail, :allow_blank => true, :case_sensitive => false
# Login must contain lettres, numbers, underscores only
# Login must contain letters, numbers, underscores only
validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i
validates_length_of :login, :maximum => 256
validates_length_of :firstname, :lastname, :maximum => 30
@ -216,7 +216,7 @@ class User < Principal
begin
write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url))
rescue OpenIdAuthentication::InvalidOpenId
# Invlaid url, don't save
# Invalid url, don't save
end
end
self.read_attribute(:identity_url)
@ -656,7 +656,7 @@ class User < Principal
end
# These are also implemented as strong_parameters, so also see
# app/modles/permitted_params.rb
# app/models/permitted_params.rb
# Delete these if everything in the UsersController uses strong_parameters.
safe_attributes 'firstname', 'lastname', 'mail', 'mail_notification', 'language',
'custom_field_values', 'custom_fields', 'identity_url'

@ -235,7 +235,7 @@ class Version < ActiveRecord::Base
# Returns the average estimated time of assigned issues
# or 1 if no issue has an estimated time
# Used to weigth unestimated issues in progress calculation
# Used to weigh unestimated issues in progress calculation
def estimated_average
if @estimated_average.nil?
average = fixed_issues.average(:estimated_hours).to_f

@ -28,7 +28,7 @@
#++
# While loading the Issue class below, we lazy load the Project class. Which itself need WorkPackage.
# So we create an 'emtpy' Issue class first, to make Project happy.
# So we create an 'empty' Issue class first, to make Project happy.
class WorkPackage < ActiveRecord::Base
@ -471,7 +471,7 @@ class WorkPackage < ActiveRecord::Base
end
# >>> issues.rb >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# Returns the mail adresses of users that should be notified
# Returns the mail addresses of users that should be notified
def recipients
notified = project.notified_users
# Author and assignee are always notified unless they have been
@ -1006,11 +1006,11 @@ class WorkPackage < ActiveRecord::Base
def close_duplicates
if closing?
duplicates.each do |duplicate|
# Reload is need in case the duplicate was updated by a previous duplicate
# Reload is needed in case the duplicate was updated by a previous duplicate
duplicate.reload
# Don't re-close it if it's already closed
next if duplicate.closed?
# Implicitely creates a new journal
# Implicitly creates a new journal
duplicate.update_attribute :status, self.status
# Same user and notes
duplicate.journals.last.user = current_journal.user

Loading…
Cancel
Save