OSDN Git Service
(root)
/
pettanr
/
pettanr.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
picture's test are all green
[pettanr/pettanr.git]
/
app
/
models
/
author.rb
1
class Author < ActiveRecord::Base
2
has_one :artist
3
belongs_to :user
4
5
before_save do |r|
6
r.name = 'no name' if r.name.blank?
7
end
8
9
def artist?
10
Artist.find_by_author(self) != nil
11
end
12
13
def step2 n
14
self.name = n
15
self.save
16
end
17
18
end