Sha256: 60751b3b37ea79046610ed7c9803c29a093fba05729bcc28f4f381f1fd2d29e9

Contents?: true

Size: 413 Bytes

Versions: 1

Compression:

Stored size: 413 Bytes

Contents

module Iconly
  module Concerns
    module Models
      module User
        extend ActiveSupport::Concern

        included do
          has_many :packages
          has_many :projects

          after_create :generate_project
        end

        private

        def generate_project
          return if projects.any?
          projects.create!(name: 'Untitled Project')
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iconly-1.0.0 lib/iconly/concerns/models/user.rb