Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/humpyard/active_record/acts/container_element.rb,
lib/humpyard/active_record/has/title_for_url.rb,
lib/humpyard/active_record/acts/element.rb,
lib/humpyard/active_record/acts/asset.rb,
lib/humpyard/active_record/acts/page.rb

Class Method Summary collapse

Class Method Details

.acts_as_humpyard_asset(options = {}) ⇒ Object



64
65
66
67
# File 'lib/humpyard/active_record/acts/asset.rb', line 64

def self.acts_as_humpyard_asset(options = {})
  set_table_name "#{Humpyard::config.table_name_prefix}assets_#{name.split('::').last.underscore.pluralize}" if options[:system_asset]
  include Humpyard::ActiveRecord::Acts::Asset
end

.acts_as_humpyard_container_element(options = {}) ⇒ Object



22
23
24
25
# File 'lib/humpyard/active_record/acts/container_element.rb', line 22

def self.acts_as_humpyard_container_element(options = {})
  acts_as_humpyard_element options
  include Humpyard::ActiveRecord::Acts::ContainerElement
end

.acts_as_humpyard_element(options = {}) ⇒ Object



85
86
87
88
# File 'lib/humpyard/active_record/acts/element.rb', line 85

def self.acts_as_humpyard_element(options = {})
  set_table_name "#{Humpyard::config.table_name_prefix}elements_#{name.split('::').last.underscore.pluralize}" if options[:system_element]
  include Humpyard::ActiveRecord::Acts::Element
end

.acts_as_humpyard_page(options = {}) ⇒ Object



97
98
99
100
# File 'lib/humpyard/active_record/acts/page.rb', line 97

def self.acts_as_humpyard_page(options = {})
  set_table_name "#{Humpyard::config.table_name_prefix}pages_#{name.split('::').last.underscore.pluralize}" if options[:system_page]
  include Humpyard::ActiveRecord::Acts::Page
end

.has_title_for_url(options = {}) ⇒ Object



72
73
74
# File 'lib/humpyard/active_record/has/title_for_url.rb', line 72

def self.has_title_for_url(options = {})
  include Humpyard::ActiveRecord::Has::TitleForUrl
end