Sha256: fc30a9cb7812294163d543146a18a8672a8035efb9d00ba9ee66ab915e271126

Contents?: true

Size: 304 Bytes

Versions: 6

Compression:

Stored size: 304 Bytes

Contents

module FunkyForm
  module InstanceMethods
    # @param [#to_hash, #attributes] target
    def initialize(target = {})
      if target.respond_to?(:attributes)
        super(target.attributes)
      else
        super
      end
    end

    def persisted?
      defined?(id) && !id.nil?
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
funky_form-0.2.1 lib/funky_form/instance_methods.rb
funky_form-0.2.0 lib/funky_form/instance_methods.rb
funky_form-0.1.3 lib/funky_form/instance_methods.rb
funky_form-0.1.2 lib/funky_form/instance_methods.rb
funky_form-0.1.1 lib/funky_form/instance_methods.rb
funky_form-0.1.0 lib/funky_form/instance_methods.rb