Patch #27510 » 27510-v2.patch
| app/models/principal.rb | ||
|---|---|---|
| 136 | 136 |
nil |
| 137 | 137 |
end |
| 138 | 138 | |
| 139 |
def active? |
|
| 140 |
self.status == STATUS_ACTIVE |
|
| 141 |
end |
|
| 142 | ||
| 139 | 143 |
def visible?(user=User.current) |
| 140 | 144 |
Principal.visible(user).find_by(:id => id) == self |
| 141 | 145 |
end |
| app/models/user.rb | ||
|---|---|---|
| 273 | 273 |
end |
| 274 | 274 |
end |
| 275 | 275 | |
| 276 |
def active? |
|
| 277 |
self.status == STATUS_ACTIVE |
|
| 278 |
end |
|
| 279 | ||
| 280 | 276 |
def registered? |
| 281 | 277 |
self.status == STATUS_REGISTERED |
| 282 | 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 |
- « Previous
- 1
- 2
- 3
- Next »