Module: Saucy::Project

Extended by:
ActiveSupport::Concern
Included in:
Project
Defined in:
lib/saucy/project.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#assign_default_permissionsObject



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

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)


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

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

#to_paramObject



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

def to_param
  keyword
end