1class ModerationDelay |
|
2 include ActiveModel::Model |
|
4 attr_accessor :subject, :body |
|
6 validates :subject, presence: true, length: { maximum: 100 } |
|
7 validates :body, presence: true, length: { maximum: 2000 } |
|
|
9 def attributes |
10 { "subject" => subject, "body" => body } |
|
11 end |
|
|
13 def attributes=(hash) |
14 hash = hash.stringify_keys
|
|
16 hash.each do |key, value| |
|
17 if respond_to?("#{key}=") |
|
18 public_send("#{key}=", value) |
|
19 end |
|
20 end |
|
21 end |
|
22end |