Module: Saucy::Project::ClassMethods

Defined in:
lib/saucy/project.rb

Instance Method Summary collapse

Instance Method Details

#activeObject



55
56
57
# File 'lib/saucy/project.rb', line 55

def active
  where(:archived => false)
end

#archivedObject



51
52
53
# File 'lib/saucy/project.rb', line 51

def archived
  where(:archived => true)
end

#build_with_default_permissionsObject



63
64
65
# File 'lib/saucy/project.rb', line 63

def build_with_default_permissions
  new.assign_default_permissions
end

#by_nameObject



59
60
61
# File 'lib/saucy/project.rb', line 59

def by_name
  order("projects.name")
end

#visible_to(user) ⇒ Object



47
48
49
# File 'lib/saucy/project.rb', line 47

def visible_to(user)
  where(['projects.id IN(?)', user.project_ids])
end