Sha256: 2220266ee0aa10c5275221f973669f6ad70371dcd051373b35a01f23f822c1f7

Contents?: true

Size: 564 Bytes

Versions: 12

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

require 'eac_rails_utils/patches/active_model_associations'
require 'virtus'

module EacRailsUtils
  module Models
    class Tableless
      include ActiveModel::Model
      include Virtus.model
      include EacRailsUtils::Models::TablelessAssociations

      def initialize(values = {})
        super(build_attributes(values))
      end

      def save!
        save || raise("#{self.class}.save failed: #{errors.messages}")
      end

      require_sub __FILE__, require_mode: :kernel, include_modules: :include
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
eac_rails_utils-0.25.0 lib/eac_rails_utils/models/tableless.rb
eac_rails_utils-0.24.0 lib/eac_rails_utils/models/tableless.rb
eac_rails_utils-0.23.4 lib/eac_rails_utils/models/tableless.rb
eac_rails_utils-0.23.3 lib/eac_rails_utils/models/tableless.rb
eac_rails_utils-0.23.2 lib/eac_rails_utils/models/tableless.rb
eac_rails_utils-0.23.1 lib/eac_rails_utils/models/tableless.rb
eac_rails_utils-0.23.0 lib/eac_rails_utils/models/tableless.rb
eac_rails_utils-0.22.3 lib/eac_rails_utils/models/tableless.rb
eac_rails_utils-0.22.2 lib/eac_rails_utils/models/tableless.rb
eac_rails_utils-0.22.1 lib/eac_rails_utils/models/tableless.rb
eac_rails_utils-0.22.0 lib/eac_rails_utils/models/tableless.rb
eac_rails_utils-0.21.0 lib/eac_rails_utils/models/tableless.rb