Sha256: 088055b484683f8e3a94f8f93d229e6b2092d8f2dd2e57adfdddf8cc3ce0c0bd

Contents?: true

Size: 463 Bytes

Versions: 24

Compression:

Stored size: 463 Bytes

Contents

class Flexite::BaseForm
  include ActiveModel::Validations
  include ActiveModel::Conversion
  extend ActiveModel::Naming

  attr_reader :attributes

  def initialize(attributes = {})
    @attributes = HashWithIndifferentAccess.new

    attributes.each do |name, value|
      send("#{name}=", value) rescue next
      @attributes[name] = value
    end
  end

  def persisted?
    respond_to?(:id) && id.present?
  end

  def new_record?
    !persisted?
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
flexite-0.0.25 app/forms/flexite/base_form.rb
flexite-0.0.24 app/forms/flexite/base_form.rb
flexite-0.0.23 app/forms/flexite/base_form.rb
flexite-0.0.22 app/forms/flexite/base_form.rb
flexite-0.0.21 app/forms/flexite/base_form.rb
flexite-0.0.20 app/forms/flexite/base_form.rb
flexite-0.0.19 app/forms/flexite/base_form.rb
flexite-0.0.18 app/forms/flexite/base_form.rb
flexite-0.0.17 app/forms/flexite/base_form.rb
flexite-0.0.16 app/forms/flexite/base_form.rb
flexite-0.0.15 app/forms/flexite/base_form.rb
flexite-0.0.14 app/forms/flexite/base_form.rb
flexite-0.0.13 app/forms/flexite/base_form.rb
flexite-0.0.12 app/forms/flexite/base_form.rb
flexite-0.0.11 app/forms/flexite/base_form.rb
flexite-0.0.10 app/forms/flexite/base_form.rb
flexite-0.0.9 app/forms/flexite/base_form.rb
flexite-0.0.8 app/forms/flexite/base_form.rb
flexite-0.0.7 app/forms/flexite/base_form.rb
flexite-0.0.6 app/forms/flexite/base_form.rb