mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
20 lines
316 B
Ruby
20 lines
316 B
Ruby
class Topic
|
|
include ActiveModel::Validations
|
|
|
|
attr_accessor :title, :author_name, :content, :approved
|
|
|
|
def initialize(attributes = {})
|
|
attributes.each do |key, value|
|
|
send "#{key}=", value
|
|
end
|
|
end
|
|
|
|
def condition_is_true
|
|
true
|
|
end
|
|
|
|
def condition_is_true_but_its_not
|
|
false
|
|
end
|
|
end
|