Sha256: 4d2cca446379f6a84c68d15ee19efb6b5f35d0b7fbbad119d43ba1bc59395bf5

Contents?: true

Size: 418 Bytes

Versions: 1

Compression:

Stored size: 418 Bytes

Contents

# frozen_string_literal: true

ActiveRecord::Base.connection.create_table(:books, force: true) do |t|
  t.string  :title
  t.string  :body
  t.integer :user_id
  t.decimal :discount_percentage, precision: 5, scale: 2
  t.integer :images_count, default: 0
  t.date    :publish_date
end

class Book < ActiveRecord::Base
  second_level_cache

  belongs_to :user, counter_cache: true
  has_many :images, as: :imagable
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
second_level_cache-2.5.3 test/model/book.rb