Module: Saucy::Project::InstanceMethods

Defined in:
lib/saucy/project.rb

Instance Method Summary collapse

Instance Method Details

#assign_default_permissionsObject



79
80
81
82
83
84
# File 'lib/saucy/project.rb', line 79

def assign_default_permissions
  .memberships.where(:admin => true).each do |membership|
    self.permissions.build(:membership => membership)
  end
  self
end

#has_member?(user) ⇒ Boolean

Returns:

  • (Boolean)


73
74
75
76
77
# File 'lib/saucy/project.rb', line 73

def has_member?(user)
  permissions.
    joins(:membership).
    exists?(:memberships => { :user_id => user.id })
end

#to_paramObject



69
70
71
# File 'lib/saucy/project.rb', line 69

def to_param
  keyword
end