Module: Housekeeping::Projects

Extended by:
ActiveSupport::Concern
Defined in:
lib/housekeeping/projects.rb

Overview

Concern the provides housekeeping and related methods for models that belong_to a Project

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) annotates_community_object?

This will have to be extended via role exceptions, maybe. It is a loose check here, ripped right from mx. def prevent_alteration_in_other_projects

# unless (self.project_id == $project_id)
#   raise 'Not owned by current project: ' + self.name + '#' + self.id.to_s
# end

end

Returns:

  • (Boolean)


51
52
53
# File 'lib/housekeeping/projects.rb', line 51

def annotates_community_object?
  self.respond_to?(:is_community_annotation?) && self.is_community_annotation?
end

- (Boolean) is_community?

Returns:

  • (Boolean)


55
56
57
# File 'lib/housekeeping/projects.rb', line 55

def is_community?
  (self.class <= Shared::SharedAcrossProjects) ? true : false
end

- (Object) set_project_id



37
38
39
40
41
# File 'lib/housekeeping/projects.rb', line 37

def set_project_id
  if self.new_record?
    self.project_id ||= $project_id
  end
end