Module: Alchemy

Defined in:
app/models/alchemy/tag.rb,
app/models/alchemy.rb,
app/models/alchemy/site.rb,
app/models/alchemy/cell.rb,
app/models/alchemy/page.rb,
app/models/alchemy/content.rb,
app/models/alchemy/element.rb,
app/models/alchemy/message.rb,
app/models/alchemy/picture.rb,
app/models/alchemy/language.rb,
app/models/alchemy/tree_node.rb,
app/mailers/alchemy/messages.rb,
app/models/alchemy/attachment.rb,
app/models/alchemy/folded_page.rb,
app/helpers/alchemy/url_helper.rb,
app/models/alchemy/site/layout.rb,
app/helpers/alchemy/base_helper.rb,
app/models/alchemy/essence_date.rb,
app/models/alchemy/essence_html.rb,
app/models/alchemy/essence_link.rb,
app/models/alchemy/essence_file.rb,
app/models/alchemy/essence_text.rb,
app/helpers/alchemy/pages_helper.rb,
app/models/alchemy/essence_select.rb,
app/models/alchemy/page/page_users.rb,
app/models/alchemy/content/factory.rb,
app/models/alchemy/essence_picture.rb,
app/models/alchemy/page/page_cells.rb,
app/models/alchemy/essence_boolean.rb,
app/helpers/alchemy/elements_helper.rb,
app/models/alchemy/picture/sweeping.rb,
app/helpers/alchemy/essences_helper.rb,
app/models/alchemy/page/page_scopes.rb,
app/models/alchemy/page/page_naming.rb,
app/models/alchemy/essence_richtext.rb,
app/models/alchemy/page/page_natures.rb,
app/helpers/alchemy/admin/tags_helper.rb,
app/helpers/alchemy/admin/base_helper.rb,
app/models/alchemy/element/presenters.rb,
app/helpers/alchemy/admin/form_helper.rb,
app/models/alchemy/page/page_elements.rb,
app/models/alchemy/element/definitions.rb,
app/helpers/alchemy/admin/pages_helper.rb,
app/serializers/alchemy/page_serializer.rb,
app/serializers/alchemy/cell_serializer.rb,
app/controllers/alchemy/base_controller.rb,
app/controllers/alchemy/pages_controller.rb,
app/helpers/alchemy/elements_block_helper.rb,
app/helpers/alchemy/admin/essences_helper.rb,
app/helpers/alchemy/admin/pictures_helper.rb,
app/helpers/alchemy/admin/contents_helper.rb,
app/helpers/alchemy/admin/elements_helper.rb,
app/serializers/alchemy/content_serializer.rb,
app/serializers/alchemy/picture_serializer.rb,
app/models/alchemy/picture/transformations.rb,
app/serializers/alchemy/element_serializer.rb,
app/controllers/alchemy/pictures_controller.rb,
app/controllers/alchemy/elements_controller.rb,
app/controllers/alchemy/contents_controller.rb,
app/controllers/alchemy/api/base_controller.rb,
app/helpers/alchemy/admin/navigation_helper.rb,
app/controllers/alchemy/messages_controller.rb,
app/helpers/alchemy/admin/attachments_helper.rb,
app/controllers/alchemy/api/pages_controller.rb,
app/controllers/alchemy/admin/base_controller.rb,
app/controllers/alchemy/admin/tags_controller.rb,
app/serializers/alchemy/attachment_serializer.rb,
app/controllers/alchemy/admin/trash_controller.rb,
app/controllers/alchemy/admin/sites_controller.rb,
app/controllers/alchemy/admin/pages_controller.rb,
app/controllers/alchemy/attachments_controller.rb,
app/serializers/alchemy/essence_text_serializer.rb,
app/controllers/alchemy/api/elements_controller.rb,
app/serializers/alchemy/essence_file_serializer.rb,
app/serializers/alchemy/essence_date_serializer.rb,
app/serializers/alchemy/essence_html_serializer.rb,
app/serializers/alchemy/essence_link_serializer.rb,
app/controllers/alchemy/api/contents_controller.rb,
app/controllers/alchemy/admin/contents_controller.rb,
app/serializers/alchemy/essence_select_serializer.rb,
app/controllers/alchemy/admin/elements_controller.rb,
app/controllers/alchemy/admin/pictures_controller.rb,
app/serializers/alchemy/legacy_element_serializer.rb,
app/controllers/alchemy/admin/languages_controller.rb,
app/serializers/alchemy/essence_picture_serializer.rb,
app/controllers/alchemy/admin/clipboard_controller.rb,
app/serializers/alchemy/essence_boolean_serializer.rb,
app/controllers/alchemy/admin/dashboard_controller.rb,
app/controllers/alchemy/admin/resources_controller.rb,
app/serializers/alchemy/essence_richtext_serializer.rb,
app/controllers/alchemy/admin/layoutpages_controller.rb,
app/controllers/alchemy/admin/attachments_controller.rb,
app/controllers/alchemy/admin/essence_files_controller.rb,
app/controllers/alchemy/admin/legacy_page_urls_controller.rb,
app/controllers/alchemy/admin/essence_pictures_controller.rb,
lib/alchemy_cms.rb,
lib/alchemy/i18n.rb,
lib/alchemy/hints.rb,
lib/alchemy/shell.rb,
lib/alchemy/config.rb,
lib/alchemy/seeder.rb,
lib/alchemy/logger.rb,
lib/alchemy/locale.rb,
lib/alchemy/errors.rb,
lib/alchemy/engine.rb,
lib/alchemy/tinymce.rb,
lib/alchemy/version.rb,
lib/alchemy/essence.rb,
lib/alchemy/modules.rb,
lib/alchemy/touching.rb,
lib/alchemy/upgrader.rb,
lib/alchemy/resource.rb,
lib/alchemy/filetypes.rb,
lib/alchemy/page_layout.rb,
lib/alchemy/mount_point.rb,
lib/alchemy/permissions.rb,
lib/alchemy/forms/builder.rb,
lib/alchemy/tasks/helpers.rb,
lib/alchemy/auth_accessors.rb,
lib/alchemy/resources_helper.rb,
lib/alchemy/name_conversions.rb,
lib/alchemy/picture_attributes.rb,
lib/alchemy/controller_actions.rb,
lib/rails/generators/alchemy/base.rb,
lib/alchemy/upgrader/three_point_one.rb,
lib/alchemy/test_support/auth_helpers.rb,
lib/alchemy/upgrader/three_point_zero.rb,
lib/alchemy/middleware/rescue_old_cookies.rb,
lib/alchemy/cache_digests/template_tracker.rb,
lib/alchemy/test_support/controller_requests.rb,
lib/alchemy/test_support/integration_helpers.rb,
lib/rails/generators/alchemy/module/module_generator.rb,
lib/rails/generators/alchemy/essence/essence_generator.rb,
lib/rails/generators/alchemy/scaffold/scaffold_generator.rb,
lib/rails/generators/alchemy/elements/elements_generator.rb,
lib/rails/generators/alchemy/page_layouts/page_layouts_generator.rb,
lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb,
lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb

Overview

Based on spree commerce controller hacks. github.com/spree/spree/blob/master/core/spec/support/controller_hacks.rb Thanks!

Defined Under Namespace

Modules: Admin, BaseHelper, CacheDigests, ControllerActions, ElementsBlockHelper, ElementsHelper, Essence, EssencesHelper, Filetypes, Forms, Generators, Hints, I18n, Locale, Logger, Middleware, Modules, NameConversions, PagesHelper, ResourcesHelper, Shell, Tasks, TestSupport, Tinymce, Touching, UrlHelper Classes: Attachment, AttachmentSerializer, AttachmentsController, BaseController, Cell, CellDefinitionError, CellSerializer, Config, Content, ContentDefinitionError, ContentSerializer, ContentsController, DefaultLanguageNotFoundError, Element, ElementDefinitionError, ElementSerializer, ElementsController, Engine, EssenceBoolean, EssenceBooleanSerializer, EssenceDate, EssenceDateSerializer, EssenceFile, EssenceFileSerializer, EssenceHtml, EssenceHtmlSerializer, EssenceLink, EssenceLinkSerializer, EssenceMissingError, EssencePicture, EssencePictureSerializer, EssenceRichtext, EssenceRichtextSerializer, EssenceSelect, EssenceSelectSerializer, EssenceText, EssenceTextSerializer, FoldedPage, Language, LegacyElementSerializer, LegacyPageUrl, Message, Messages, MessagesController, MissingActiveRecordAssociation, MissingImageFileError, MountPoint, NoCurrentUserFoundError, Page, PageLayout, PageLayoutDefinitionError, PageSerializer, PagesController, Permissions, Picture, PictureAttributes, PictureInUseError, PictureSerializer, PicturesController, Resource, Seeder, Site, Tag, TinymceError, TreeNode, UpdateServiceUnavailable, Upgrader

Constant Summary

VERSION =
"3.1.0.beta1"
@@user_class_name =

Defaults

'User'
@@current_user_method =
'current_user'
@@login_path =
'/login'
@@logout_path =
'/logout'

Class Method Summary collapse

Class Method Details

.register_ability(klass) ⇒ Object

Register a CanCan Ability class



64
65
66
67
# File 'lib/alchemy/auth_accessors.rb', line 64

def self.register_ability(klass)
  @abilities ||= []
  @abilities << klass
end

.registered_abilitiesObject

All CanCan Ability classes registered to Alchemy



71
72
73
# File 'lib/alchemy/auth_accessors.rb', line 71

def self.registered_abilities
  @abilities ||= []
end

.table_name_prefixObject



3
4
5
# File 'app/models/alchemy.rb', line 3

def self.table_name_prefix
  'alchemy_'
end

.user_classObject

Returns the user class

Set your App's user class to Alchemy.user_class_name in an initializer.

Defaults to User

Example

# config/initializers/alchemy.rb
Alchemy.user_class_name = 'Admin'


52
53
54
55
56
57
58
59
60
# File 'lib/alchemy/auth_accessors.rb', line 52

def self.user_class
  @@user_class ||= begin
    if @@user_class_name.is_a?(String)
      @@user_class_name.constantize
    else
      raise 'Alchemy.user_class_name must be a String, not a Class.'
    end
  end
end

.versionObject



4
5
6
# File 'lib/alchemy/version.rb', line 4

def self.version
  VERSION
end