Sha256: 089d63b3a1fe1e0b56c284567194331591395d8af99df0b5dbef187737a0686d

Contents?: true

Size: 455 Bytes

Versions: 6

Compression:

Stored size: 455 Bytes

Contents

# -*- encoding: utf-8 -*-
# -*- frozen_string_literal: true -*-
# -*- warn_indent: true -*-

class User < ApplicationRecord
  has_one :address, dependent: :destroy

  has_many :user_skills, dependent: :destroy
  has_many :skills, through: :user_skills, source: :skill

  belongs_to :fruit

  delegate :name, to: :fruit, prefix: true

  accepts_nested_attributes_for :address, update_only: true

  def address
    super.presence || build_address
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_bootstrap_form-0.3.1 demo/app/models/user.rb
rails_bootstrap_form-0.3.0 demo/app/models/user.rb
rails_bootstrap_form-0.2.3 demo/app/models/user.rb
rails_bootstrap_form-0.2.2 demo/app/models/user.rb
rails_bootstrap_form-0.2.1 demo/app/models/user.rb
rails_bootstrap_form-0.2.0 demo/app/models/user.rb