aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/models/topic.rb
blob: f25b774cd768b49eaa920ba5d7f8bb6a81269986 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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