diff --git a/app/models/guidance_group.rb b/app/models/guidance_group.rb index 201818c..c5d5c24 100644 --- a/app/models/guidance_group.rb +++ b/app/models/guidance_group.rb @@ -40,7 +40,7 @@ ## # Returns the list of all guidance groups not coming from the given organisations # - # @params excluded_orgs [Array] a list of organisations to exclude in the result + # @param excluded_orgs [Array] a list of organisations to exclude in the result # @return [Array] a list of guidance groups def self.guidance_groups_excluding(excluded_orgs) excluded_org_ids = Array.new diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 1da4a0b..10bba9c 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -51,7 +51,7 @@ ## # finds all organisations who have a parent of the passed organisation type # - # @params [String] the name of an organisation type + # @param [String] the name of an organisation type # @return [Array] def self.orgs_with_parent_of_type(org_type) parents = OrganisationType.find_by_name(org_type).organisations @@ -100,7 +100,7 @@ ## # returns a list of all sections of a given version from this organisation and it's parents # - # @params version_id [Integer] version number of the section + # @param version_id [Integer] version number of the section # @return [Array
] list of sections def all_sections(version_id) if parent.nil? @@ -141,7 +141,7 @@ ## # takes in the id of, and returns an OptionWarning # - # @params option_id [number] the id of the desired warning + # @param option_id [number] the id of the desired warning # @return [OptionWarning] the specified warning def warning(option_id) warning = option_warnings.find_by_option_id(option_id) diff --git a/app/models/plan.rb b/app/models/plan.rb index 5946db3..8bf12aa 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -104,7 +104,7 @@ ## # returns the guidances associated with the project's organisation, for a specified question # - # @params question [Question] the question to find guidance for + # @param question [Question] the question to find guidance for # @return [Array] the list of guidances which pretain to the specified question def guidance_for_question(question) guidances = {} @@ -435,7 +435,7 @@ # returns an array of hashes. Each hash contains the question's id, the answer_id, # the answer_text, the answer_timestamp, and the answer_options # - # @params section_id [Integer] the section to find answers of + # @param section_id [Integer] the section to find answers of # @return [Array nil,String,Integer,DateTime}] def section_answers(section_id) section = Section.find(section_id) @@ -477,7 +477,7 @@ # NOTE: This is only an estimate, rounded up to the nearest 5%; it is intended # for guidance when editing plan data, not to be 100% accurate. # - # @params used_height [Integer] an estimate of the height used so far + # @param used_height [Integer] an estimate of the height used so far # @return [Integer] the estimate of space used of an A4 portrain def estimate_space_used(used_height) @formatting ||= self.settings(:export).formatting @@ -501,9 +501,9 @@ # Allows for hinting different font sizes (offset from base via font_size_inc) # and vertical margins (i.e. for heading text) # - # @params text [String] the text to estimate size of - # @params font_size_inc [Integer] the size of the font of the text, defaults to 0 - # @params vertical_margin [Integer] the top margin above the text, defaults to 0 + # @param text [String] the text to estimate size of + # @param font_size_inc [Integer] the size of the font of the text, defaults to 0 + # @param vertical_margin [Integer] the top margin above the text, defaults to 0 def height_of_text(text, font_size_inc = 0, vertical_margin = 0) @formatting ||= self.settings(:export).formatting @margin_width ||= @formatting[:margin][:left].to_i + @formatting[:margin][:right].to_i diff --git a/app/models/project.rb b/app/models/project.rb index 4c14724..f205429 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -106,7 +106,7 @@ ## # sets a new institution_id if there is no current organisation # - # @params new_institution_id [Integer] the id for the new institution + # @param new_institution_id [Integer] the id for the new institution # @return [Integer, Bool] false if an organisation exists, or the id of the set org if a new organisation is set def institution_id=(new_institution_id) if organisation.nil? then @@ -130,7 +130,7 @@ # defines a new organisation_id for the project # but is confusingly labled unit_id # - # @params new_unit_id [Integer] + # @param new_unit_id [Integer] # @return [Integer, Boolean] the new organisation ID or false if no unit_id was passed def unit_id=(new_unit_id) unless new_unit_id.nil? ||new_unit_id == "" @@ -252,7 +252,7 @@ # whether or not the specified user_id created this project # should be renamed to created_by? # - # @params user_id [Integer] the user to check the priveleges of + # @param user_id [Integer] the user to check the priveleges of # @return [Boolean] true if the user created the project def created_by(user_id) user = project_groups.find_by_user_id(user_id) diff --git a/app/models/role.rb b/app/models/role.rb index c568dac..5c26aa7 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -2,8 +2,7 @@ has_and_belongs_to_many :users, :join_table => :users_roles belongs_to :resource, :polymorphic => true - - scopify + attr_accessible :name, :role_in_plans, :resource_id, :resource_type, :as => [:default, :admin] end diff --git a/app/models/user.rb b/app/models/user.rb index 4b069f4..6fd8465 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,7 +1,6 @@ class User < ActiveRecord::Base include GlobalHelpers - rolify # Include default devise modules. Others available are: # :token_authenticatable, :confirmable, # :lockable, :timeoutable and :omniauthable @@ -40,8 +39,7 @@ end end - # Commented out due to warning in Rails 4. This line is redundant due to use of the rolify gem - #has_and_belongs_to_many :roles, :join_table => :users_roles + has_and_belongs_to_many :roles, :join_table => :users_roles has_many :plan_sections @@ -149,7 +147,7 @@ ## # sets a new organisation for the user # - # @params new_organisation [Organisation] the new organisation for the user + # @param new_organisation [Organisation] the new organisation for the user def organisation=(new_organisation) organisation_id = organisation.id end