Sha256: 8d6068a497710112370e2c898a06f57ffe2a4e1f1eb15cc918688bae14de197c
Contents?: true
Size: 517 Bytes
Versions: 7
Compression:
Stored size: 517 Bytes
Contents
module Storytime class Navigation < ActiveRecord::Base include Storytime::ScopedToSite belongs_to :site has_many :links, foreign_key: :storytime_navigation_id, dependent: :destroy validates_presence_of :name, :handle before_validation :set_handle, on: :create accepts_nested_attributes_for :links, :reject_if => :all_blank, :allow_destroy => true private def set_handle self.handle = self.handle.present? ? self.handle.parameterize : self.name.parameterize end end end
Version data entries
7 entries across 7 versions & 1 rubygems