root / lib / rails_addons.rb @ master
1 |
class ActiveRecord::Base |
---|---|
2 |
# pagination
|
3 |
def self.per_page |
4 |
50
|
5 |
end
|
6 |
|
7 |
# who did the modification ?
|
8 |
before_create do |record| |
9 |
record.created_by = SharedStore.instance[:user].uid if record.has_attribute? :created_by |
10 |
end
|
11 |
before_update do |record| |
12 |
record.updated_by = SharedStore.instance[:user].uid if record.has_attribute? :updated_by |
13 |
end
|
14 |
end
|