1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/test/models/topic.rb

20 lines
316 B
Ruby
Raw Normal View History

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