Sha256: 2e6d36d73b65e8affc4c7d2db93db77403c001844e7f39db1cc2f534a4bd95fc

Contents?: true

Size: 477 Bytes

Versions: 664

Compression:

Stored size: 477 Bytes

Contents

module Caboose
  class Message
    include ActiveModel::Validations
    include ActiveModel::Conversion
    extend ActiveModel::Naming
    
    attr_accessor :name, :email, :body
    
    validates :name, :email, :body, presence: true
    validates :email, format: { :with => %r{.+@.+\..+} }, allow_blank: false
    
    def initialize(attributes={})
      attributes.each { |name, value| send("#{name}=", value) }
    end
    
    def persisted?
      false
    end
  end
end

Version data entries

664 entries across 664 versions & 1 rubygems

Version Path
caboose-cms-0.9.229 app/models/caboose/message.rb
caboose-cms-1.0.2 app/models/caboose/message.rb
caboose-cms-1.0.1 app/models/caboose/message.rb
caboose-cms-0.9.228 app/models/caboose/message.rb
caboose-cms-0.9.227 app/models/caboose/message.rb
caboose-cms-0.9.226 app/models/caboose/message.rb
caboose-cms-0.9.225 app/models/caboose/message.rb
caboose-cms-0.9.224 app/models/caboose/message.rb
caboose-cms-0.9.223 app/models/caboose/message.rb
caboose-cms-0.9.222 app/models/caboose/message.rb
caboose-cms-0.9.221 app/models/caboose/message.rb
caboose-cms-0.9.220 app/models/caboose/message.rb
caboose-cms-0.9.219 app/models/caboose/message.rb
caboose-cms-0.9.218 app/models/caboose/message.rb
caboose-cms-0.9.217 app/models/caboose/message.rb
caboose-cms-0.9.216 app/models/caboose/message.rb
caboose-cms-0.9.215 app/models/caboose/message.rb
caboose-cms-0.9.214 app/models/caboose/message.rb
caboose-cms-0.9.213 app/models/caboose/message.rb
caboose-cms-0.9.212 app/models/caboose/message.rb