Sha256: a0838797a815d9bbf6bdb475710fcf75a44ed66956c1b54c280f80008ba7d7ef
Contents?: true
Size: 678 Bytes
Versions: 3
Compression:
Stored size: 678 Bytes
Contents
module Storytime class Site < ActiveRecord::Base enum post_slug_style: [:default, :day_and_name, :month_and_name, :post_id] enum root_page_content: [:posts, :page] validates :root_post_id, presence: true, if: ->(site){ site.root_page_content == "page" } validates :title, length: { in: 1..200 } def save_with_seeds(user) self.class.setup_seeds user.update_attributes(storytime_role: Storytime::Role.find_by(name: "admin")) save end def self.setup_seeds Storytime::Role.seed Storytime::Action.seed Storytime::Permission.seed end def root_post_options Storytime::Page.published end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
storytime-1.0.2 | app/models/storytime/site.rb |
storytime-1.0.1 | app/models/storytime/site.rb |
storytime-1.0.0 | app/models/storytime/site.rb |