Sha256: c082e441da1e46645dbd7d779ae4030beb1ff2dd78a475ccaacb188a959eb25b

Contents?: true

Size: 656 Bytes

Versions: 1

Compression:

Stored size: 656 Bytes

Contents

# Copy ActiveModel::Model from Rails 4.x here
module MultiNotifier
  module Middlewares
    module ActiveModel
      module Model
        def self.included(base)
          base.class_eval do
            extend  ::ActiveModel::Naming
            extend  ::ActiveModel::Translation
            include ::ActiveModel::Validations
            include ::ActiveModel::Conversion
          end
        end

        def initialize(params={})
          params.each do |attr, value|
            self.public_send("#{attr}=", value)
          end if params

          super()
        end

        def persisted?
          false
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
multi_notifier-0.4.0 lib/multi_notifier/model.rb