Patch #27510 » 27510.patch
| app/models/principal.rb | ||
|---|---|---|
| 145 | 145 |
project.is_a?(Project) && project_ids.include?(project.id) |
| 146 | 146 |
end |
| 147 | 147 | |
| 148 |
def active? = (status == STATUS_ACTIVE) |
|
| 149 |
def registered? = (status == STATUS_REGISTERED) |
|
| 150 |
def locked? = (status == STATUS_LOCKED) |
|
| 151 | ||
| 148 | 152 |
# Returns an array of the project ids that the principal is a member of |
| 149 | 153 |
def project_ids |
| 150 | 154 |
@project_ids ||= super.freeze |
| app/models/user.rb | ||
|---|---|---|
| 273 | 273 |
end |
| 274 | 274 |
end |
| 275 | 275 | |
| 276 |
def active? |
|
| 277 |
self.status == STATUS_ACTIVE |
|
| 278 |
end |
|
| 279 | ||
| 280 |
def registered? |
|
| 281 |
self.status == STATUS_REGISTERED |
|
| 282 |
end |
|
| 283 | ||
| 284 |
def locked? |
|
| 285 |
self.status == STATUS_LOCKED |
|
| 286 |
end |
|
| 287 | ||
| 288 | 276 |
def activate |
| 289 | 277 |
self.status = STATUS_ACTIVE |
| 290 | 278 |
end |
| test/unit/group_test.rb | ||
|---|---|---|
| 38 | 38 |
assert g.save |
| 39 | 39 |
g.reload |
| 40 | 40 |
assert_equal 'New group', g.name |
| 41 |
assert_equal true, g.active? |
|
| 41 | 42 |
end |
| 42 | 43 | |
| 43 | 44 |
def test_name_should_accept_255_characters |