Sha256: 425e97d6b7234ba8f8b75155671684d4d697c32a690bd2c2b6e3948b521e8524

Contents?: true

Size: 717 Bytes

Versions: 6

Compression:

Stored size: 717 Bytes

Contents

module {{namespace_module}}
  module {{resource_module}}
    class Model < ActiveRecord::Base
      include {{resource_module}}

      self.table_name = NAMESPACE

      has_many :sessions, class_name: "{{namespace_module}}::Sessions::Model", foreign_key: "{{resource_singular}}_id", dependent: :destroy

      def self.setup!
        ActiveRecord::Migration.create_table table_name, force: true, id: :uuid do |table|
          table.string :name, null: false, default: "", index: { unique: true }

          table.datetime :created_at, null: false, index: true
          table.datetime :updated_at, null: false, index: true
          table.datetime :destroyed_at, index: true
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shogun-6.4.2 scaffold/generate/resource/model.rb
shogun-6.4.1 scaffold/generate/resource/model.rb
shogun-6.4.0 scaffold/generate/resource/model.rb
shogun-6.3.0 scaffold/generate/resource/model.rb
shogun-6.2.3 scaffold/generate/resource/model.rb
shogun-6.2.2 scaffold/generate/resource/model.rb