Patch #27510 » 27510.patch
| app/models/principal.rb | ||
|---|---|---|
|
project.is_a?(Project) && project_ids.include?(project.id)
|
||
|
end
|
||
|
def active? = (status == STATUS_ACTIVE)
|
||
|
def registered? = (status == STATUS_REGISTERED)
|
||
|
def locked? = (status == STATUS_LOCKED)
|
||
|
# Returns an array of the project ids that the principal is a member of
|
||
|
def project_ids
|
||
|
@project_ids ||= super.freeze
|
||
| app/models/user.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def active?
|
||
|
self.status == STATUS_ACTIVE
|
||
|
end
|
||
|
def registered?
|
||
|
self.status == STATUS_REGISTERED
|
||
|
end
|
||
|
def locked?
|
||
|
self.status == STATUS_LOCKED
|
||
|
end
|
||
|
def activate
|
||
|
self.status = STATUS_ACTIVE
|
||
|
end
|
||
| test/unit/group_test.rb | ||
|---|---|---|
|
assert g.save
|
||
|
g.reload
|
||
|
assert_equal 'New group', g.name
|
||
|
assert_equal true, g.active?
|
||
|
end
|
||
|
def test_name_should_accept_255_characters
|
||