Sha256: a481949de01f6503628389a8f04949f67aae74fe727d8f1c4efac505b4030a63

Contents?: true

Size: 549 Bytes

Versions: 4

Compression:

Stored size: 549 Bytes

Contents

class Structure < ActiveRecord::Base
  include Sunrise::Models::Structure
  
  has_many :questions, :dependent => :delete_all
  has_slug :prepend_id => false
  
  attr_accessible :title, :kind, :position, :parent_id, :redirect_url,
                  :position_type, :slug, :parent, :structure_type, 
                  :header_attributes, :is_visible
  
  def self.find_by_permalink!(value)
    record = find_by_permalink(value)
    raise ActiveRecord::RecordNotFound, "Couldn't find structure by #{value}" if record.nil?
    return record
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
sunrise-widgets-0.1.1 spec/dummy/app/models/defaults/structure.rb
sunrise-locales-0.1.0 spec/dummy/app/models/defaults/structure.rb
sunrise-widgets-0.1.0 spec/dummy/app/models/defaults/structure.rb
sunrise-questions-0.1.0 spec/dummy/app/models/defaults/structure.rb