browsercms 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (444) hide show
  1. data/app/controllers/cms/connectors_controller.rb +1 -1
  2. data/app/helpers/cms/application_helper.rb +2 -19
  3. data/app/helpers/cms/form_builder.rb +8 -5
  4. data/app/helpers/cms/menu_helper.rb +19 -5
  5. data/app/helpers/cms/page_helper.rb +9 -1
  6. data/app/helpers/cms/template_support.rb +21 -0
  7. data/app/models/abstract_file_block.rb +4 -0
  8. data/app/models/connector.rb +7 -3
  9. data/app/models/dynamic_view.rb +2 -4
  10. data/app/models/portlet.rb +22 -9
  11. data/app/models/section.rb +7 -5
  12. data/app/views/cms/blocks/_toolbar_for_member.html.erb +4 -4
  13. data/app/views/cms/blocks/index.html.erb +1 -1
  14. data/app/views/cms/blocks/usages.html.erb +44 -34
  15. data/app/views/cms/connectors/new.html.erb +2 -2
  16. data/app/views/cms/dynamic_views/_form.html.erb +1 -1
  17. data/app/views/cms/dynamic_views/index.html.erb +7 -3
  18. data/app/views/cms/email_messages/index.html.erb +3 -5
  19. data/app/views/cms/form_builder/_cms_datetime_select.html.erb +12 -0
  20. data/app/views/cms/form_builder/_cms_text_editor.html.erb +2 -2
  21. data/app/views/cms/form_builder/_cms_text_field.html.erb +1 -2
  22. data/app/views/cms/groups/_permissions.html.erb +1 -0
  23. data/app/views/cms/groups/_sections.html.erb +1 -0
  24. data/app/views/cms/groups/index.html.erb +3 -5
  25. data/app/views/cms/page_routes/index.html.erb +13 -7
  26. data/app/views/cms/page_routes/show.html.erb +4 -4
  27. data/app/views/cms/pages/_edit_connector.html.erb +4 -1
  28. data/app/views/cms/pages/_edit_container.html.erb +4 -1
  29. data/app/views/cms/redirects/index.html.erb +12 -7
  30. data/app/views/cms/routes/index.html.erb +11 -7
  31. data/app/views/cms/sections/_form.html.erb +4 -5
  32. data/app/views/cms/users/_groups.html.erb +1 -0
  33. data/app/views/layouts/_cms_toolbar.html.erb +37 -4
  34. data/app/views/layouts/_page_toolbar.html.erb +2 -2
  35. data/browsercms.gemspec +381 -3
  36. data/db/demo/data.rb +2 -1
  37. data/doc/app/classes/AbstractFileBlock.html +146 -0
  38. data/doc/app/classes/ActiveRecord.html +105 -0
  39. data/doc/app/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html +242 -0
  40. data/doc/app/classes/ActiveSupport.html +111 -0
  41. data/doc/app/classes/ActiveSupport/Cache.html +111 -0
  42. data/doc/app/classes/ActiveSupport/Cache/FileStore.html +146 -0
  43. data/doc/app/classes/ActsAsList.html +147 -0
  44. data/doc/app/classes/ActsAsList/ClassMethods.html +202 -0
  45. data/doc/app/classes/ActsAsList/InstanceMethods.html +510 -0
  46. data/doc/app/classes/ApplicationController.html +119 -0
  47. data/doc/app/classes/ApplicationHelper.html +112 -0
  48. data/doc/app/classes/Attachment.html +726 -0
  49. data/doc/app/classes/Category.html +230 -0
  50. data/doc/app/classes/CategoryType.html +214 -0
  51. data/doc/app/classes/Cms.html +638 -0
  52. data/doc/app/classes/Cms/Acts.html +111 -0
  53. data/doc/app/classes/Cms/Acts/ContentBlock.html +146 -0
  54. data/doc/app/classes/Cms/Acts/ContentBlock/MacroMethods.html +165 -0
  55. data/doc/app/classes/Cms/Acts/ContentBlock/MacroMethods/InstanceMethods.html +140 -0
  56. data/doc/app/classes/Cms/ApplicationController.html +418 -0
  57. data/doc/app/classes/Cms/ApplicationHelper.html +814 -0
  58. data/doc/app/classes/Cms/AttachmentsController.html +154 -0
  59. data/doc/app/classes/Cms/Authentication.html +116 -0
  60. data/doc/app/classes/Cms/Authentication/Controller.html +702 -0
  61. data/doc/app/classes/Cms/Authentication/Model.html +165 -0
  62. data/doc/app/classes/Cms/Authentication/Model/ClassMethods.html +246 -0
  63. data/doc/app/classes/Cms/Authentication/Model/InstanceMethods.html +412 -0
  64. data/doc/app/classes/Cms/BaseController.html +113 -0
  65. data/doc/app/classes/Cms/Behaviors.html +235 -0
  66. data/doc/app/classes/Cms/Behaviors/Archiving.html +147 -0
  67. data/doc/app/classes/Cms/Behaviors/Archiving/InstanceMethods.html +220 -0
  68. data/doc/app/classes/Cms/Behaviors/Archiving/MacroMethods.html +175 -0
  69. data/doc/app/classes/Cms/Behaviors/Attaching.html +160 -0
  70. data/doc/app/classes/Cms/Behaviors/Attaching/InstanceMethods.html +670 -0
  71. data/doc/app/classes/Cms/Behaviors/Attaching/MacroMethods.html +188 -0
  72. data/doc/app/classes/Cms/Behaviors/Categorizing.html +148 -0
  73. data/doc/app/classes/Cms/Behaviors/Categorizing/ClassMethods.html +105 -0
  74. data/doc/app/classes/Cms/Behaviors/Categorizing/InstanceMethods.html +140 -0
  75. data/doc/app/classes/Cms/Behaviors/Categorizing/MacroMethods.html +178 -0
  76. data/doc/app/classes/Cms/Behaviors/ClassMethods.html +272 -0
  77. data/doc/app/classes/Cms/Behaviors/Connecting.html +148 -0
  78. data/doc/app/classes/Cms/Behaviors/Connecting/ClassMethods.html +188 -0
  79. data/doc/app/classes/Cms/Behaviors/Connecting/InstanceMethods.html +312 -0
  80. data/doc/app/classes/Cms/Behaviors/Connecting/MacroMethods.html +184 -0
  81. data/doc/app/classes/Cms/Behaviors/DynamicAttributes.html +285 -0
  82. data/doc/app/classes/Cms/Behaviors/DynamicAttributes/InstanceMethods.html +181 -0
  83. data/doc/app/classes/Cms/Behaviors/DynamicAttributes/MacroMethods.html +243 -0
  84. data/doc/app/classes/Cms/Behaviors/FlushCacheOnChange.html +178 -0
  85. data/doc/app/classes/Cms/Behaviors/FlushCacheOnChange/InstanceMethods.html +142 -0
  86. data/doc/app/classes/Cms/Behaviors/FlushCacheOnChange/MacroMethods.html +175 -0
  87. data/doc/app/classes/Cms/Behaviors/Hiding.html +148 -0
  88. data/doc/app/classes/Cms/Behaviors/Hiding/ClassMethods.html +105 -0
  89. data/doc/app/classes/Cms/Behaviors/Hiding/InstanceMethods.html +220 -0
  90. data/doc/app/classes/Cms/Behaviors/Hiding/MacroMethods.html +176 -0
  91. data/doc/app/classes/Cms/Behaviors/InstanceMethods.html +234 -0
  92. data/doc/app/classes/Cms/Behaviors/Pagination.html +151 -0
  93. data/doc/app/classes/Cms/Behaviors/Pagination/ClassMethods.html +252 -0
  94. data/doc/app/classes/Cms/Behaviors/Pagination/Collection.html +437 -0
  95. data/doc/app/classes/Cms/Behaviors/Pagination/InvalidPage.html +146 -0
  96. data/doc/app/classes/Cms/Behaviors/Publishing.html +179 -0
  97. data/doc/app/classes/Cms/Behaviors/Publishing/ClassMethods.html +105 -0
  98. data/doc/app/classes/Cms/Behaviors/Publishing/InstanceMethods.html +333 -0
  99. data/doc/app/classes/Cms/Behaviors/Publishing/MacroMethods.html +180 -0
  100. data/doc/app/classes/Cms/Behaviors/Rendering.html +179 -0
  101. data/doc/app/classes/Cms/Behaviors/Rendering/MacroMethods.html +186 -0
  102. data/doc/app/classes/Cms/Behaviors/Searching.html +147 -0
  103. data/doc/app/classes/Cms/Behaviors/Searching/ClassMethods.html +164 -0
  104. data/doc/app/classes/Cms/Behaviors/Searching/MacroMethods.html +188 -0
  105. data/doc/app/classes/Cms/Behaviors/SoftDeleting.html +148 -0
  106. data/doc/app/classes/Cms/Behaviors/SoftDeleting/ClassMethods.html +217 -0
  107. data/doc/app/classes/Cms/Behaviors/SoftDeleting/InstanceMethods.html +247 -0
  108. data/doc/app/classes/Cms/Behaviors/SoftDeleting/MacroMethods.html +205 -0
  109. data/doc/app/classes/Cms/Behaviors/Taggable.html +148 -0
  110. data/doc/app/classes/Cms/Behaviors/Taggable/ClassMethods.html +164 -0
  111. data/doc/app/classes/Cms/Behaviors/Taggable/InstanceMethods.html +197 -0
  112. data/doc/app/classes/Cms/Behaviors/Taggable/MacroMethods.html +182 -0
  113. data/doc/app/classes/Cms/Behaviors/Userstamping.html +148 -0
  114. data/doc/app/classes/Cms/Behaviors/Userstamping/ClassMethods.html +105 -0
  115. data/doc/app/classes/Cms/Behaviors/Userstamping/InstanceMethods.html +143 -0
  116. data/doc/app/classes/Cms/Behaviors/Userstamping/MacroMethods.html +181 -0
  117. data/doc/app/classes/Cms/Behaviors/Versioning.html +148 -0
  118. data/doc/app/classes/Cms/Behaviors/Versioning/ClassMethods.html +237 -0
  119. data/doc/app/classes/Cms/Behaviors/Versioning/InstanceMethods.html +685 -0
  120. data/doc/app/classes/Cms/Behaviors/Versioning/MacroMethods.html +290 -0
  121. data/doc/app/classes/Cms/CacheController.html +174 -0
  122. data/doc/app/classes/Cms/Caching.html +171 -0
  123. data/doc/app/classes/Cms/CategoriesController.html +113 -0
  124. data/doc/app/classes/Cms/CategoryTypesController.html +148 -0
  125. data/doc/app/classes/Cms/ConnectorsController.html +215 -0
  126. data/doc/app/classes/Cms/ContentBlockController.html +1175 -0
  127. data/doc/app/classes/Cms/ContentController.html +313 -0
  128. data/doc/app/classes/Cms/ContentTypesController.html +148 -0
  129. data/doc/app/classes/Cms/DashboardController.html +151 -0
  130. data/doc/app/classes/Cms/DataLoader.html +182 -0
  131. data/doc/app/classes/Cms/DynamicViewsController.html +359 -0
  132. data/doc/app/classes/Cms/EmailMessagesController.html +172 -0
  133. data/doc/app/classes/Cms/ErrorHandling.html +172 -0
  134. data/doc/app/classes/Cms/Errors.html +111 -0
  135. data/doc/app/classes/Cms/Errors/AccessDenied.html +146 -0
  136. data/doc/app/classes/Cms/Extensions.html +140 -0
  137. data/doc/app/classes/Cms/Extensions/ActionView.html +111 -0
  138. data/doc/app/classes/Cms/Extensions/ActionView/Base.html +141 -0
  139. data/doc/app/classes/Cms/Extensions/ActiveRecord.html +116 -0
  140. data/doc/app/classes/Cms/Extensions/ActiveRecord/Base.html +144 -0
  141. data/doc/app/classes/Cms/Extensions/ActiveRecord/Errors.html +140 -0
  142. data/doc/app/classes/Cms/Extensions/Hash.html +175 -0
  143. data/doc/app/classes/Cms/Extensions/Integer.html +146 -0
  144. data/doc/app/classes/Cms/Extensions/NilClass.html +212 -0
  145. data/doc/app/classes/Cms/Extensions/String.html +212 -0
  146. data/doc/app/classes/Cms/FileBlocksController.html +113 -0
  147. data/doc/app/classes/Cms/FormBuilder.html +312 -0
  148. data/doc/app/classes/Cms/FormTagHelper.html +245 -0
  149. data/doc/app/classes/Cms/GroupsController.html +225 -0
  150. data/doc/app/classes/Cms/HomeController.html +148 -0
  151. data/doc/app/classes/Cms/HtmlBlocksController.html +113 -0
  152. data/doc/app/classes/Cms/ImageBlocksController.html +113 -0
  153. data/doc/app/classes/Cms/LinksController.html +341 -0
  154. data/doc/app/classes/Cms/MenuHelper.html +330 -0
  155. data/doc/app/classes/Cms/PageHelper.html +292 -0
  156. data/doc/app/classes/Cms/PageRouteConditionsController.html +113 -0
  157. data/doc/app/classes/Cms/PageRouteOptionsController.html +355 -0
  158. data/doc/app/classes/Cms/PageRouteRequirementsController.html +113 -0
  159. data/doc/app/classes/Cms/PageRoutesController.html +284 -0
  160. data/doc/app/classes/Cms/PagesController.html +331 -0
  161. data/doc/app/classes/Cms/PathHelper.html +268 -0
  162. data/doc/app/classes/Cms/PortletController.html +150 -0
  163. data/doc/app/classes/Cms/PortletsController.html +301 -0
  164. data/doc/app/classes/Cms/RedirectsController.html +172 -0
  165. data/doc/app/classes/Cms/ResourceController.html +616 -0
  166. data/doc/app/classes/Cms/Routes.html +303 -0
  167. data/doc/app/classes/Cms/RoutesController.html +164 -0
  168. data/doc/app/classes/Cms/SectionNodesController.html +272 -0
  169. data/doc/app/classes/Cms/SectionNodesHelper.html +145 -0
  170. data/doc/app/classes/Cms/SectionsController.html +542 -0
  171. data/doc/app/classes/Cms/SessionsController.html +270 -0
  172. data/doc/app/classes/Cms/TagsController.html +152 -0
  173. data/doc/app/classes/Cms/TasksController.html +221 -0
  174. data/doc/app/classes/Cms/ToolbarController.html +153 -0
  175. data/doc/app/classes/Cms/UsersController.html +405 -0
  176. data/doc/app/classes/Connector.html +350 -0
  177. data/doc/app/classes/ContentType.html +448 -0
  178. data/doc/app/classes/ContentTypeGroup.html +111 -0
  179. data/doc/app/classes/DynamicPortlet.html +148 -0
  180. data/doc/app/classes/DynamicView.html +411 -0
  181. data/doc/app/classes/EmailMessage.html +228 -0
  182. data/doc/app/classes/EmailMessageMailer.html +150 -0
  183. data/doc/app/classes/EmailPagePortlet.html +184 -0
  184. data/doc/app/classes/FileBlock.html +202 -0
  185. data/doc/app/classes/Group.html +170 -0
  186. data/doc/app/classes/GroupPermission.html +111 -0
  187. data/doc/app/classes/GroupSection.html +111 -0
  188. data/doc/app/classes/GroupType.html +111 -0
  189. data/doc/app/classes/GroupTypePermission.html +111 -0
  190. data/doc/app/classes/GuestUser.html +347 -0
  191. data/doc/app/classes/HtmlBlock.html +170 -0
  192. data/doc/app/classes/ImageBlock.html +202 -0
  193. data/doc/app/classes/InitialData.html +171 -0
  194. data/doc/app/classes/Link.html +249 -0
  195. data/doc/app/classes/LoginPortlet.html +151 -0
  196. data/doc/app/classes/Page.html +954 -0
  197. data/doc/app/classes/PagePartial.html +201 -0
  198. data/doc/app/classes/PageRoute.html +335 -0
  199. data/doc/app/classes/PageRouteCondition.html +113 -0
  200. data/doc/app/classes/PageRouteOption.html +111 -0
  201. data/doc/app/classes/PageRouteRequirement.html +113 -0
  202. data/doc/app/classes/PageTemplate.html +278 -0
  203. data/doc/app/classes/Permission.html +111 -0
  204. data/doc/app/classes/Portlet.html +738 -0
  205. data/doc/app/classes/Redirect.html +111 -0
  206. data/doc/app/classes/Section.html +580 -0
  207. data/doc/app/classes/SectionNode.html +410 -0
  208. data/doc/app/classes/Sequence.html +146 -0
  209. data/doc/app/classes/Site.html +253 -0
  210. data/doc/app/classes/Tag.html +292 -0
  211. data/doc/app/classes/TagCloudPortlet.html +176 -0
  212. data/doc/app/classes/Tagging.html +146 -0
  213. data/doc/app/classes/Task.html +288 -0
  214. data/doc/app/classes/User.html +618 -0
  215. data/doc/app/classes/UserGroupMembership.html +111 -0
  216. data/doc/app/created.rid +1 -0
  217. data/doc/app/files/app/controllers/application_controller_rb.html +109 -0
  218. data/doc/app/files/app/controllers/cms/application_controller_rb.html +101 -0
  219. data/doc/app/files/app/controllers/cms/attachments_controller_rb.html +101 -0
  220. data/doc/app/files/app/controllers/cms/base_controller_rb.html +101 -0
  221. data/doc/app/files/app/controllers/cms/cache_controller_rb.html +101 -0
  222. data/doc/app/files/app/controllers/cms/categories_controller_rb.html +101 -0
  223. data/doc/app/files/app/controllers/cms/category_types_controller_rb.html +101 -0
  224. data/doc/app/files/app/controllers/cms/connectors_controller_rb.html +101 -0
  225. data/doc/app/files/app/controllers/cms/content_block_controller_rb.html +107 -0
  226. data/doc/app/files/app/controllers/cms/content_controller_rb.html +101 -0
  227. data/doc/app/files/app/controllers/cms/content_types_controller_rb.html +101 -0
  228. data/doc/app/files/app/controllers/cms/dashboard_controller_rb.html +101 -0
  229. data/doc/app/files/app/controllers/cms/dynamic_views_controller_rb.html +101 -0
  230. data/doc/app/files/app/controllers/cms/email_messages_controller_rb.html +101 -0
  231. data/doc/app/files/app/controllers/cms/error_handling_rb.html +101 -0
  232. data/doc/app/files/app/controllers/cms/file_blocks_controller_rb.html +101 -0
  233. data/doc/app/files/app/controllers/cms/groups_controller_rb.html +101 -0
  234. data/doc/app/files/app/controllers/cms/home_controller_rb.html +101 -0
  235. data/doc/app/files/app/controllers/cms/html_blocks_controller_rb.html +101 -0
  236. data/doc/app/files/app/controllers/cms/image_blocks_controller_rb.html +101 -0
  237. data/doc/app/files/app/controllers/cms/links_controller_rb.html +101 -0
  238. data/doc/app/files/app/controllers/cms/page_route_conditions_controller_rb.html +101 -0
  239. data/doc/app/files/app/controllers/cms/page_route_options_controller_rb.html +101 -0
  240. data/doc/app/files/app/controllers/cms/page_route_requirements_controller_rb.html +101 -0
  241. data/doc/app/files/app/controllers/cms/page_routes_controller_rb.html +101 -0
  242. data/doc/app/files/app/controllers/cms/pages_controller_rb.html +101 -0
  243. data/doc/app/files/app/controllers/cms/portlet_controller_rb.html +101 -0
  244. data/doc/app/files/app/controllers/cms/portlets_controller_rb.html +101 -0
  245. data/doc/app/files/app/controllers/cms/redirects_controller_rb.html +101 -0
  246. data/doc/app/files/app/controllers/cms/resource_controller_rb.html +108 -0
  247. data/doc/app/files/app/controllers/cms/routes_controller_rb.html +101 -0
  248. data/doc/app/files/app/controllers/cms/section_nodes_controller_rb.html +101 -0
  249. data/doc/app/files/app/controllers/cms/sections_controller_rb.html +101 -0
  250. data/doc/app/files/app/controllers/cms/sessions_controller_rb.html +107 -0
  251. data/doc/app/files/app/controllers/cms/tags_controller_rb.html +101 -0
  252. data/doc/app/files/app/controllers/cms/tasks_controller_rb.html +101 -0
  253. data/doc/app/files/app/controllers/cms/toolbar_controller_rb.html +101 -0
  254. data/doc/app/files/app/controllers/cms/users_controller_rb.html +101 -0
  255. data/doc/app/files/app/helpers/application_helper_rb.html +108 -0
  256. data/doc/app/files/app/helpers/cms/application_helper_rb.html +107 -0
  257. data/doc/app/files/app/helpers/cms/form_builder_rb.html +101 -0
  258. data/doc/app/files/app/helpers/cms/form_tag_helper_rb.html +101 -0
  259. data/doc/app/files/app/helpers/cms/menu_helper_rb.html +101 -0
  260. data/doc/app/files/app/helpers/cms/page_helper_rb.html +101 -0
  261. data/doc/app/files/app/helpers/cms/path_helper_rb.html +101 -0
  262. data/doc/app/files/app/helpers/cms/section_nodes_helper_rb.html +101 -0
  263. data/doc/app/files/app/models/abstract_file_block_rb.html +101 -0
  264. data/doc/app/files/app/models/attachment_rb.html +109 -0
  265. data/doc/app/files/app/models/category_rb.html +101 -0
  266. data/doc/app/files/app/models/category_type_rb.html +101 -0
  267. data/doc/app/files/app/models/connector_rb.html +101 -0
  268. data/doc/app/files/app/models/content_type_group_rb.html +101 -0
  269. data/doc/app/files/app/models/content_type_rb.html +101 -0
  270. data/doc/app/files/app/models/dynamic_view_rb.html +101 -0
  271. data/doc/app/files/app/models/email_message_mailer_rb.html +101 -0
  272. data/doc/app/files/app/models/email_message_rb.html +101 -0
  273. data/doc/app/files/app/models/file_block_rb.html +101 -0
  274. data/doc/app/files/app/models/group_permission_rb.html +101 -0
  275. data/doc/app/files/app/models/group_rb.html +101 -0
  276. data/doc/app/files/app/models/group_section_rb.html +101 -0
  277. data/doc/app/files/app/models/group_type_permission_rb.html +101 -0
  278. data/doc/app/files/app/models/group_type_rb.html +101 -0
  279. data/doc/app/files/app/models/guest_user_rb.html +101 -0
  280. data/doc/app/files/app/models/html_block_rb.html +101 -0
  281. data/doc/app/files/app/models/image_block_rb.html +101 -0
  282. data/doc/app/files/app/models/link_rb.html +101 -0
  283. data/doc/app/files/app/models/page_partial_rb.html +101 -0
  284. data/doc/app/files/app/models/page_rb.html +101 -0
  285. data/doc/app/files/app/models/page_route_condition_rb.html +101 -0
  286. data/doc/app/files/app/models/page_route_option_rb.html +101 -0
  287. data/doc/app/files/app/models/page_route_rb.html +101 -0
  288. data/doc/app/files/app/models/page_route_requirement_rb.html +101 -0
  289. data/doc/app/files/app/models/page_template_rb.html +101 -0
  290. data/doc/app/files/app/models/permission_rb.html +101 -0
  291. data/doc/app/files/app/models/portlet_rb.html +101 -0
  292. data/doc/app/files/app/models/redirect_rb.html +101 -0
  293. data/doc/app/files/app/models/section_node_rb.html +101 -0
  294. data/doc/app/files/app/models/section_rb.html +101 -0
  295. data/doc/app/files/app/models/site_rb.html +101 -0
  296. data/doc/app/files/app/models/tag_rb.html +101 -0
  297. data/doc/app/files/app/models/tagging_rb.html +101 -0
  298. data/doc/app/files/app/models/task_rb.html +101 -0
  299. data/doc/app/files/app/models/user_group_membership_rb.html +101 -0
  300. data/doc/app/files/app/models/user_rb.html +108 -0
  301. data/doc/app/files/app/portlets/dynamic_portlet_rb.html +101 -0
  302. data/doc/app/files/app/portlets/email_page_portlet_rb.html +101 -0
  303. data/doc/app/files/app/portlets/login_portlet_rb.html +101 -0
  304. data/doc/app/files/app/portlets/tag_cloud_portlet_rb.html +101 -0
  305. data/doc/app/files/doc/README_FOR_APP.html +127 -0
  306. data/doc/app/files/lib/acts_as_list_rb.html +101 -0
  307. data/doc/app/files/lib/browsercms_rb.html +113 -0
  308. data/doc/app/files/lib/cms/acts/content_block_rb.html +101 -0
  309. data/doc/app/files/lib/cms/authentication/controller_rb.html +101 -0
  310. data/doc/app/files/lib/cms/authentication/model_rb.html +101 -0
  311. data/doc/app/files/lib/cms/behaviors/archiving_rb.html +101 -0
  312. data/doc/app/files/lib/cms/behaviors/attaching_rb.html +101 -0
  313. data/doc/app/files/lib/cms/behaviors/categorizing_rb.html +101 -0
  314. data/doc/app/files/lib/cms/behaviors/connecting_rb.html +101 -0
  315. data/doc/app/files/lib/cms/behaviors/dynamic_attributes_rb.html +101 -0
  316. data/doc/app/files/lib/cms/behaviors/flush_cache_on_change_rb.html +101 -0
  317. data/doc/app/files/lib/cms/behaviors/hiding_rb.html +101 -0
  318. data/doc/app/files/lib/cms/behaviors/pagination_rb.html +107 -0
  319. data/doc/app/files/lib/cms/behaviors/publishing_rb.html +101 -0
  320. data/doc/app/files/lib/cms/behaviors/rendering_rb.html +101 -0
  321. data/doc/app/files/lib/cms/behaviors/searching_rb.html +101 -0
  322. data/doc/app/files/lib/cms/behaviors/soft_deleting_rb.html +101 -0
  323. data/doc/app/files/lib/cms/behaviors/taggable_rb.html +101 -0
  324. data/doc/app/files/lib/cms/behaviors/userstamping_rb.html +101 -0
  325. data/doc/app/files/lib/cms/behaviors/versioning_rb.html +101 -0
  326. data/doc/app/files/lib/cms/behaviors_rb.html +147 -0
  327. data/doc/app/files/lib/cms/caching_rb.html +101 -0
  328. data/doc/app/files/lib/cms/data_loader_rb.html +101 -0
  329. data/doc/app/files/lib/cms/extensions/action_view/base_rb.html +101 -0
  330. data/doc/app/files/lib/cms/extensions/active_record/base_rb.html +101 -0
  331. data/doc/app/files/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements_rb.html +101 -0
  332. data/doc/app/files/lib/cms/extensions/active_record/errors_rb.html +101 -0
  333. data/doc/app/files/lib/cms/extensions/active_support/cache/file_store_rb.html +101 -0
  334. data/doc/app/files/lib/cms/extensions/hash_rb.html +101 -0
  335. data/doc/app/files/lib/cms/extensions/integer_rb.html +101 -0
  336. data/doc/app/files/lib/cms/extensions/nil_rb.html +101 -0
  337. data/doc/app/files/lib/cms/extensions/string_rb.html +101 -0
  338. data/doc/app/files/lib/cms/extensions_rb.html +101 -0
  339. data/doc/app/files/lib/cms/init_rb.html +101 -0
  340. data/doc/app/files/lib/cms/routes_rb.html +101 -0
  341. data/doc/app/files/lib/initial_data_rb.html +101 -0
  342. data/doc/app/files/lib/sequence_rb.html +101 -0
  343. data/doc/app/fr_class_index.html +205 -0
  344. data/doc/app/fr_file_index.html +152 -0
  345. data/doc/app/fr_method_index.html +738 -0
  346. data/doc/app/index.html +24 -0
  347. data/doc/app/rdoc-style.css +208 -0
  348. data/doc/guides/html/build_it_yourself.html +175 -0
  349. data/doc/guides/html/deployment_guide.html +181 -0
  350. data/doc/guides/html/designer_guide.html +153 -0
  351. data/doc/guides/html/developer_guide.html +266 -0
  352. data/doc/guides/html/files/javascripts/code_highlighter.js +188 -0
  353. data/doc/guides/html/files/javascripts/guides.js +7 -0
  354. data/doc/guides/html/files/javascripts/highlighters.js +90 -0
  355. data/doc/guides/html/files/stylesheets/main.css +441 -0
  356. data/doc/guides/html/files/stylesheets/reset.css +43 -0
  357. data/doc/guides/html/files/stylesheets/style.css +13 -0
  358. data/doc/guides/html/files/stylesheets/syntax.css +31 -0
  359. data/doc/guides/html/getting_started.html +181 -0
  360. data/doc/guides/html/images/bg.png +0 -0
  361. data/doc/guides/html/images/bottom_cap.png +0 -0
  362. data/doc/guides/html/images/browsercms_logo.png +0 -0
  363. data/doc/guides/html/images/dot.png +0 -0
  364. data/doc/guides/html/images/icons/README +5 -0
  365. data/doc/guides/html/images/icons/callouts/1.png +0 -0
  366. data/doc/guides/html/images/icons/callouts/10.png +0 -0
  367. data/doc/guides/html/images/icons/callouts/11.png +0 -0
  368. data/doc/guides/html/images/icons/callouts/12.png +0 -0
  369. data/doc/guides/html/images/icons/callouts/13.png +0 -0
  370. data/doc/guides/html/images/icons/callouts/14.png +0 -0
  371. data/doc/guides/html/images/icons/callouts/15.png +0 -0
  372. data/doc/guides/html/images/icons/callouts/2.png +0 -0
  373. data/doc/guides/html/images/icons/callouts/3.png +0 -0
  374. data/doc/guides/html/images/icons/callouts/4.png +0 -0
  375. data/doc/guides/html/images/icons/callouts/5.png +0 -0
  376. data/doc/guides/html/images/icons/callouts/6.png +0 -0
  377. data/doc/guides/html/images/icons/callouts/7.png +0 -0
  378. data/doc/guides/html/images/icons/callouts/8.png +0 -0
  379. data/doc/guides/html/images/icons/callouts/9.png +0 -0
  380. data/doc/guides/html/images/icons/caution.png +0 -0
  381. data/doc/guides/html/images/icons/example.png +0 -0
  382. data/doc/guides/html/images/icons/home.png +0 -0
  383. data/doc/guides/html/images/icons/important.png +0 -0
  384. data/doc/guides/html/images/icons/next.png +0 -0
  385. data/doc/guides/html/images/icons/note.png +0 -0
  386. data/doc/guides/html/images/icons/prev.png +0 -0
  387. data/doc/guides/html/images/icons/tip.png +0 -0
  388. data/doc/guides/html/images/icons/up.png +0 -0
  389. data/doc/guides/html/images/icons/warning.png +0 -0
  390. data/doc/guides/html/images/top_cap.png +0 -0
  391. data/doc/guides/html/images/top_cap_content.png +0 -0
  392. data/doc/guides/html/index.html +168 -0
  393. data/doc/guides/html/installing_modules.html +181 -0
  394. data/doc/guides/html/user_guide.html +266 -0
  395. data/lib/cms/behaviors/attaching.rb +1 -1
  396. data/lib/cms/behaviors/rendering.rb +1 -1
  397. data/lib/cms/behaviors/taggable.rb +2 -1
  398. data/lib/cms/behaviors/versioning.rb +1 -1
  399. data/lib/cms/init.rb +4 -4
  400. data/lib/tasks/cms.rake +16 -42
  401. data/public/images/cms/buttons/button_cap_off_middle.gif +0 -0
  402. data/public/images/cms/buttons/button_left_bg.png +0 -0
  403. data/public/images/cms/buttons/button_off_middle.png +0 -0
  404. data/public/images/cms/nav_admin.gif +0 -0
  405. data/public/images/cms/nav_admin_h.gif +0 -0
  406. data/public/images/cms/nav_admin_on.gif +0 -0
  407. data/public/images/cms/nav_content_library.gif +0 -0
  408. data/public/images/cms/nav_content_library_h.gif +0 -0
  409. data/public/images/cms/nav_content_library_on.gif +0 -0
  410. data/public/images/cms/nav_dash.gif +0 -0
  411. data/public/images/cms/nav_dash_h.gif +0 -0
  412. data/public/images/cms/nav_dash_on.gif +0 -0
  413. data/public/images/cms/nav_sitemap.gif +0 -0
  414. data/public/images/cms/nav_sitemap_h.gif +0 -0
  415. data/public/images/cms/nav_sitemap_on.gif +0 -0
  416. data/public/stylesheets/cms/administration.css +91 -91
  417. data/public/stylesheets/cms/block.css +25 -25
  418. data/public/stylesheets/cms/buttons.css +120 -111
  419. data/public/stylesheets/cms/content_library.css +2 -1
  420. data/public/stylesheets/cms/content_types.css +3 -3
  421. data/public/stylesheets/cms/dashboard.css +118 -118
  422. data/public/stylesheets/cms/data_table.css +155 -155
  423. data/public/stylesheets/cms/form_layout.css +269 -269
  424. data/public/stylesheets/cms/jquery.contextMenu.css +61 -61
  425. data/public/stylesheets/cms/login.css +77 -77
  426. data/public/stylesheets/cms/menu.css +116 -116
  427. data/public/stylesheets/cms/nav.css +98 -111
  428. data/public/stylesheets/cms/page_toolbar.css +134 -134
  429. data/public/stylesheets/cms/sitemap.css +31 -15
  430. data/rails_generators/content_block/content_block_generator.rb +4 -9
  431. data/rails_generators/content_block/templates/_form.html.erb +3 -1
  432. data/rails_generators/portlet/portlet_generator.rb +2 -6
  433. data/rails_generators/portlet/templates/_form.html.erb +1 -0
  434. data/templates/blank.rb +30 -0
  435. data/templates/demo.rb +28 -0
  436. data/templates/module.rb +945 -0
  437. data/test/functional/cms/connectors_controller_test.rb +12 -1
  438. data/test/functional/cms/portlets_controller_test.rb +10 -0
  439. data/test/unit/behaviors/taggable_test.rb +19 -0
  440. data/test/unit/helpers/menu_helper_test.rb +72 -1
  441. data/test/unit/lib/generators_test.rb +21 -3
  442. data/test/unit/models/connector_test.rb +16 -0
  443. data/test/unit/models/sections_test.rb +4 -0
  444. metadata +380 -2
@@ -0,0 +1,237 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Module: Cms::Behaviors::Versioning::ClassMethods</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">Cms::Behaviors::Versioning::ClassMethods</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../../files/lib/cms/behaviors/versioning_rb.html">
59
+ lib/cms/behaviors/versioning.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+
76
+
77
+ </div>
78
+
79
+ <div id="method-list">
80
+ <h3 class="section-bar">Methods</h3>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000320">version_class</a>&nbsp;&nbsp;
84
+ <a href="#M000321">version_class_name</a>&nbsp;&nbsp;
85
+ <a href="#M000322">version_foreign_key</a>&nbsp;&nbsp;
86
+ <a href="#M000323">version_table_name</a>&nbsp;&nbsp;
87
+ <a href="#M000324">versioned_columns</a>&nbsp;&nbsp;
88
+ </div>
89
+ </div>
90
+
91
+ </div>
92
+
93
+
94
+ <!-- if includes -->
95
+
96
+ <div id="section">
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+ <!-- if method_list -->
106
+ <div id="methods">
107
+ <h3 class="section-bar">Public Instance methods</h3>
108
+
109
+ <div id="method-M000320" class="method-detail">
110
+ <a name="M000320"></a>
111
+
112
+ <div class="method-heading">
113
+ <a href="#M000320" class="method-signature">
114
+ <span class="method-name">version_class</span><span class="method-args">()</span>
115
+ </a>
116
+ </div>
117
+
118
+ <div class="method-description">
119
+ <p><a class="source-toggle" href="#"
120
+ onclick="toggleCode('M000320-source');return false;">[Source]</a></p>
121
+ <div class="method-source-code" id="M000320-source">
122
+ <pre>
123
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 50</span>
124
+ 50: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">version_class</span>
125
+ 51: <span class="ruby-identifier">const_get</span> <span class="ruby-value str">&quot;Version&quot;</span>
126
+ 52: <span class="ruby-keyword kw">end</span>
127
+ </pre>
128
+ </div>
129
+ </div>
130
+ </div>
131
+
132
+ <div id="method-M000321" class="method-detail">
133
+ <a name="M000321"></a>
134
+
135
+ <div class="method-heading">
136
+ <a href="#M000321" class="method-signature">
137
+ <span class="method-name">version_class_name</span><span class="method-args">()</span>
138
+ </a>
139
+ </div>
140
+
141
+ <div class="method-description">
142
+ <p><a class="source-toggle" href="#"
143
+ onclick="toggleCode('M000321-source');return false;">[Source]</a></p>
144
+ <div class="method-source-code" id="M000321-source">
145
+ <pre>
146
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 54</span>
147
+ 54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">version_class_name</span>
148
+ 55: <span class="ruby-node">&quot;#{name}::Version&quot;</span>
149
+ 56: <span class="ruby-keyword kw">end</span>
150
+ </pre>
151
+ </div>
152
+ </div>
153
+ </div>
154
+
155
+ <div id="method-M000322" class="method-detail">
156
+ <a name="M000322"></a>
157
+
158
+ <div class="method-heading">
159
+ <a href="#M000322" class="method-signature">
160
+ <span class="method-name">version_foreign_key</span><span class="method-args">()</span>
161
+ </a>
162
+ </div>
163
+
164
+ <div class="method-description">
165
+ <p><a class="source-toggle" href="#"
166
+ onclick="toggleCode('M000322-source');return false;">[Source]</a></p>
167
+ <div class="method-source-code" id="M000322-source">
168
+ <pre>
169
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 58</span>
170
+ 58: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">version_foreign_key</span>
171
+ 59: <span class="ruby-ivar">@version_foreign_key</span>
172
+ 60: <span class="ruby-keyword kw">end</span>
173
+ </pre>
174
+ </div>
175
+ </div>
176
+ </div>
177
+
178
+ <div id="method-M000323" class="method-detail">
179
+ <a name="M000323"></a>
180
+
181
+ <div class="method-heading">
182
+ <a href="#M000323" class="method-signature">
183
+ <span class="method-name">version_table_name</span><span class="method-args">()</span>
184
+ </a>
185
+ </div>
186
+
187
+ <div class="method-description">
188
+ <p><a class="source-toggle" href="#"
189
+ onclick="toggleCode('M000323-source');return false;">[Source]</a></p>
190
+ <div class="method-source-code" id="M000323-source">
191
+ <pre>
192
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 62</span>
193
+ 62: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">version_table_name</span>
194
+ 63: <span class="ruby-ivar">@version_table_name</span>
195
+ 64: <span class="ruby-keyword kw">end</span>
196
+ </pre>
197
+ </div>
198
+ </div>
199
+ </div>
200
+
201
+ <div id="method-M000324" class="method-detail">
202
+ <a name="M000324"></a>
203
+
204
+ <div class="method-heading">
205
+ <a href="#M000324" class="method-signature">
206
+ <span class="method-name">versioned_columns</span><span class="method-args">()</span>
207
+ </a>
208
+ </div>
209
+
210
+ <div class="method-description">
211
+ <p><a class="source-toggle" href="#"
212
+ onclick="toggleCode('M000324-source');return false;">[Source]</a></p>
213
+ <div class="method-source-code" id="M000324-source">
214
+ <pre>
215
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 66</span>
216
+ 66: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">versioned_columns</span>
217
+ 67: <span class="ruby-ivar">@versioned_columns</span> <span class="ruby-operator">||=</span> (<span class="ruby-identifier">version_class</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">keys</span> <span class="ruby-operator">-</span>
218
+ 68: (<span class="ruby-node">%w[id lock_version position version_comment created_at updated_at created_by_id updated_by_id type]</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">version_foreign_key</span>]))
219
+ 69: <span class="ruby-keyword kw">end</span>
220
+ </pre>
221
+ </div>
222
+ </div>
223
+ </div>
224
+
225
+
226
+ </div>
227
+
228
+
229
+ </div>
230
+
231
+
232
+ <div id="validator-badges">
233
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
234
+ </div>
235
+
236
+ </body>
237
+ </html>
@@ -0,0 +1,685 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Module: Cms::Behaviors::Versioning::InstanceMethods</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">Cms::Behaviors::Versioning::InstanceMethods</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../../files/lib/cms/behaviors/versioning_rb.html">
59
+ lib/cms/behaviors/versioning.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+
76
+
77
+ </div>
78
+
79
+ <div id="method-list">
80
+ <h3 class="section-bar">Methods</h3>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000342">as_of_draft_version</a>&nbsp;&nbsp;
84
+ <a href="#M000343">as_of_version</a>&nbsp;&nbsp;
85
+ <a href="#M000331">build_new_version</a>&nbsp;&nbsp;
86
+ <a href="#M000340">current_version</a>&nbsp;&nbsp;
87
+ <a href="#M000333">default_version_comment</a>&nbsp;&nbsp;
88
+ <a href="#M000336">draft</a>&nbsp;&nbsp;
89
+ <a href="#M000332">draft_attributes</a>&nbsp;&nbsp;
90
+ <a href="#M000337">draft_version?</a>&nbsp;&nbsp;
91
+ <a href="#M000341">find_version</a>&nbsp;&nbsp;
92
+ <a href="#M000330">initialize_version</a>&nbsp;&nbsp;
93
+ <a href="#M000338">live_version</a>&nbsp;&nbsp;
94
+ <a href="#M000339">live_version?</a>&nbsp;&nbsp;
95
+ <a href="#M000344">revert</a>&nbsp;&nbsp;
96
+ <a href="#M000346">revert_to</a>&nbsp;&nbsp;
97
+ <a href="#M000345">revert_to_without_save</a>&nbsp;&nbsp;
98
+ <a href="#M000334">save</a>&nbsp;&nbsp;
99
+ <a href="#M000335">save!</a>&nbsp;&nbsp;
100
+ <a href="#M000347">version_comment</a>&nbsp;&nbsp;
101
+ <a href="#M000348">version_comment=</a>&nbsp;&nbsp;
102
+ </div>
103
+ </div>
104
+
105
+ </div>
106
+
107
+
108
+ <!-- if includes -->
109
+
110
+ <div id="section">
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+ <!-- if method_list -->
120
+ <div id="methods">
121
+ <h3 class="section-bar">Public Instance methods</h3>
122
+
123
+ <div id="method-M000342" class="method-detail">
124
+ <a name="M000342"></a>
125
+
126
+ <div class="method-heading">
127
+ <a href="#M000342" class="method-signature">
128
+ <span class="method-name">as_of_draft_version</span><span class="method-args">()</span>
129
+ </a>
130
+ </div>
131
+
132
+ <div class="method-description">
133
+ <p><a class="source-toggle" href="#"
134
+ onclick="toggleCode('M000342-source');return false;">[Source]</a></p>
135
+ <div class="method-source-code" id="M000342-source">
136
+ <pre>
137
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 202</span>
138
+ 202: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">as_of_draft_version</span>
139
+ 203: <span class="ruby-identifier">as_of_version</span>(<span class="ruby-identifier">draft</span>.<span class="ruby-identifier">version</span>)
140
+ 204: <span class="ruby-keyword kw">end</span>
141
+ </pre>
142
+ </div>
143
+ </div>
144
+ </div>
145
+
146
+ <div id="method-M000343" class="method-detail">
147
+ <a name="M000343"></a>
148
+
149
+ <div class="method-heading">
150
+ <a href="#M000343" class="method-signature">
151
+ <span class="method-name">as_of_version</span><span class="method-args">(version)</span>
152
+ </a>
153
+ </div>
154
+
155
+ <div class="method-description">
156
+ <p><a class="source-toggle" href="#"
157
+ onclick="toggleCode('M000343-source');return false;">[Source]</a></p>
158
+ <div class="method-source-code" id="M000343-source">
159
+ <pre>
160
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 206</span>
161
+ 206: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">as_of_version</span>(<span class="ruby-identifier">version</span>)
162
+ 207: <span class="ruby-identifier">v</span> = <span class="ruby-identifier">find_version</span>(<span class="ruby-identifier">version</span>)
163
+ 208: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">RecordNotFound</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;version #{version.inspect} does not exist for &lt;#{self.class}:#{id}&gt;&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">v</span>
164
+ 209: <span class="ruby-identifier">obj</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
165
+ 210:
166
+ 211: (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">versioned_columns</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">:version</span>, <span class="ruby-identifier">:updated_at</span>]).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
167
+ 212: <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{a}=&quot;</span>, <span class="ruby-identifier">v</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">a</span>))
168
+ 213: <span class="ruby-keyword kw">end</span>
169
+ 214: <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">id</span> = <span class="ruby-identifier">id</span>
170
+ 215: <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">lock_version</span> = <span class="ruby-identifier">lock_version</span>
171
+ 216:
172
+ 217: <span class="ruby-comment cmt"># Need to do this so associations can be loaded</span>
173
+ 218: <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value str">&quot;@new_record&quot;</span>, <span class="ruby-keyword kw">false</span>)
174
+ 219:
175
+ 220: <span class="ruby-comment cmt"># Callback to allow us to load other data when an older version is loaded</span>
176
+ 221: <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">after_as_of_version</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:after_as_of_version</span>)
177
+ 222:
178
+ 223: <span class="ruby-comment cmt"># Last but not least, clear the changed attributes</span>
179
+ 224: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">changed_attrs</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:changed_attributes</span>)
180
+ 225: <span class="ruby-identifier">changed_attrs</span>.<span class="ruby-identifier">clear</span>
181
+ 226: <span class="ruby-keyword kw">end</span>
182
+ 227:
183
+ 228: <span class="ruby-identifier">obj</span>
184
+ 229: <span class="ruby-keyword kw">end</span>
185
+ </pre>
186
+ </div>
187
+ </div>
188
+ </div>
189
+
190
+ <div id="method-M000331" class="method-detail">
191
+ <a name="M000331"></a>
192
+
193
+ <div class="method-heading">
194
+ <a href="#M000331" class="method-signature">
195
+ <span class="method-name">build_new_version</span><span class="method-args">()</span>
196
+ </a>
197
+ </div>
198
+
199
+ <div class="method-description">
200
+ <p><a class="source-toggle" href="#"
201
+ onclick="toggleCode('M000331-source');return false;">[Source]</a></p>
202
+ <div class="method-source-code" id="M000331-source">
203
+ <pre>
204
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 76</span>
205
+ 76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_new_version</span>
206
+ 77: <span class="ruby-comment cmt"># First get the values from the draft</span>
207
+ 78: <span class="ruby-identifier">attrs</span> = <span class="ruby-identifier">draft_attributes</span>
208
+ 79:
209
+ 80: <span class="ruby-comment cmt"># Now overwrite any changed values </span>
210
+ 81: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">versioned_columns</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">col</span><span class="ruby-operator">|</span>
211
+ 82: <span class="ruby-keyword kw">if</span>(<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{col}_changed?&quot;</span>))
212
+ 83: <span class="ruby-identifier">attrs</span>[<span class="ruby-identifier">col</span>] = <span class="ruby-identifier">send</span>(<span class="ruby-identifier">col</span>)
213
+ 84: <span class="ruby-keyword kw">end</span>
214
+ 85: <span class="ruby-keyword kw">end</span>
215
+ 86:
216
+ 87: <span class="ruby-identifier">attrs</span>[<span class="ruby-identifier">:version_comment</span>] = <span class="ruby-ivar">@version_comment</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">default_version_comment</span>
217
+ 88: <span class="ruby-ivar">@version_comment</span> = <span class="ruby-keyword kw">nil</span>
218
+ 89: <span class="ruby-identifier">new_version</span> = <span class="ruby-identifier">versions</span>.<span class="ruby-identifier">build</span>(<span class="ruby-identifier">attrs</span>)
219
+ 90: <span class="ruby-identifier">new_version</span>.<span class="ruby-identifier">version</span> = <span class="ruby-identifier">new_record?</span> <span class="ruby-value">? </span><span class="ruby-value">1</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">draft</span>.<span class="ruby-identifier">version</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
220
+ 91: <span class="ruby-identifier">after_build_new_version</span>(<span class="ruby-identifier">new_version</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:after_build_new_version</span>)
221
+ 92: <span class="ruby-identifier">new_version</span>
222
+ 93: <span class="ruby-keyword kw">end</span>
223
+ </pre>
224
+ </div>
225
+ </div>
226
+ </div>
227
+
228
+ <div id="method-M000340" class="method-detail">
229
+ <a name="M000340"></a>
230
+
231
+ <div class="method-heading">
232
+ <a href="#M000340" class="method-signature">
233
+ <span class="method-name">current_version</span><span class="method-args">()</span>
234
+ </a>
235
+ </div>
236
+
237
+ <div class="method-description">
238
+ <p><a class="source-toggle" href="#"
239
+ onclick="toggleCode('M000340-source');return false;">[Source]</a></p>
240
+ <div class="method-source-code" id="M000340-source">
241
+ <pre>
242
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 194</span>
243
+ 194: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_version</span>
244
+ 195: <span class="ruby-identifier">find_version</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span>)
245
+ 196: <span class="ruby-keyword kw">end</span>
246
+ </pre>
247
+ </div>
248
+ </div>
249
+ </div>
250
+
251
+ <div id="method-M000333" class="method-detail">
252
+ <a name="M000333"></a>
253
+
254
+ <div class="method-heading">
255
+ <a href="#M000333" class="method-signature">
256
+ <span class="method-name">default_version_comment</span><span class="method-args">()</span>
257
+ </a>
258
+ </div>
259
+
260
+ <div class="method-description">
261
+ <p><a class="source-toggle" href="#"
262
+ onclick="toggleCode('M000333-source');return false;">[Source]</a></p>
263
+ <div class="method-source-code" id="M000333-source">
264
+ <pre>
265
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 102</span>
266
+ 102: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_version_comment</span>
267
+ 103: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">new_record?</span>
268
+ 104: <span class="ruby-value str">&quot;Created&quot;</span>
269
+ 105: <span class="ruby-keyword kw">else</span>
270
+ 106: <span class="ruby-node">&quot;Changed #{(changes.keys - %w[version created_by_id updated_by_id]).sort.join(', ')}&quot;</span>
271
+ 107: <span class="ruby-keyword kw">end</span>
272
+ 108: <span class="ruby-keyword kw">end</span>
273
+ </pre>
274
+ </div>
275
+ </div>
276
+ </div>
277
+
278
+ <div id="method-M000336" class="method-detail">
279
+ <a name="M000336"></a>
280
+
281
+ <div class="method-heading">
282
+ <a href="#M000336" class="method-signature">
283
+ <span class="method-name">draft</span><span class="method-args">()</span>
284
+ </a>
285
+ </div>
286
+
287
+ <div class="method-description">
288
+ <p><a class="source-toggle" href="#"
289
+ onclick="toggleCode('M000336-source');return false;">[Source]</a></p>
290
+ <div class="method-source-code" id="M000336-source">
291
+ <pre>
292
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 178</span>
293
+ 178: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draft</span>
294
+ 179: <span class="ruby-identifier">versions</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">:order</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;version desc&quot;</span>)
295
+ 180: <span class="ruby-keyword kw">end</span>
296
+ </pre>
297
+ </div>
298
+ </div>
299
+ </div>
300
+
301
+ <div id="method-M000332" class="method-detail">
302
+ <a name="M000332"></a>
303
+
304
+ <div class="method-heading">
305
+ <a href="#M000332" class="method-signature">
306
+ <span class="method-name">draft_attributes</span><span class="method-args">()</span>
307
+ </a>
308
+ </div>
309
+
310
+ <div class="method-description">
311
+ <p><a class="source-toggle" href="#"
312
+ onclick="toggleCode('M000332-source');return false;">[Source]</a></p>
313
+ <div class="method-source-code" id="M000332-source">
314
+ <pre>
315
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 95</span>
316
+ 95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draft_attributes</span>
317
+ 96: <span class="ruby-comment cmt"># When there is no draft, we'll just copy the attibutes from this object</span>
318
+ 97: <span class="ruby-comment cmt"># Otherwise we need to use the draft</span>
319
+ 98: <span class="ruby-identifier">d</span> = <span class="ruby-identifier">new_record?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">draft</span>
320
+ 99: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">versioned_columns</span>.<span class="ruby-identifier">inject</span>({}){<span class="ruby-operator">|</span><span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">col</span><span class="ruby-operator">|</span> <span class="ruby-identifier">attrs</span>[<span class="ruby-identifier">col</span>] = <span class="ruby-identifier">d</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">col</span>); <span class="ruby-identifier">attrs</span> }
321
+ 100: <span class="ruby-keyword kw">end</span>
322
+ </pre>
323
+ </div>
324
+ </div>
325
+ </div>
326
+
327
+ <div id="method-M000337" class="method-detail">
328
+ <a name="M000337"></a>
329
+
330
+ <div class="method-heading">
331
+ <a href="#M000337" class="method-signature">
332
+ <span class="method-name">draft_version?</span><span class="method-args">()</span>
333
+ </a>
334
+ </div>
335
+
336
+ <div class="method-description">
337
+ <p><a class="source-toggle" href="#"
338
+ onclick="toggleCode('M000337-source');return false;">[Source]</a></p>
339
+ <div class="method-source-code" id="M000337-source">
340
+ <pre>
341
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 182</span>
342
+ 182: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draft_version?</span>
343
+ 183: <span class="ruby-identifier">version</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">draft</span>.<span class="ruby-identifier">version</span>
344
+ 184: <span class="ruby-keyword kw">end</span>
345
+ </pre>
346
+ </div>
347
+ </div>
348
+ </div>
349
+
350
+ <div id="method-M000341" class="method-detail">
351
+ <a name="M000341"></a>
352
+
353
+ <div class="method-heading">
354
+ <a href="#M000341" class="method-signature">
355
+ <span class="method-name">find_version</span><span class="method-args">(number)</span>
356
+ </a>
357
+ </div>
358
+
359
+ <div class="method-description">
360
+ <p><a class="source-toggle" href="#"
361
+ onclick="toggleCode('M000341-source');return false;">[Source]</a></p>
362
+ <div class="method-source-code" id="M000341-source">
363
+ <pre>
364
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 198</span>
365
+ 198: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_version</span>(<span class="ruby-identifier">number</span>)
366
+ 199: <span class="ruby-identifier">versions</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> { <span class="ruby-identifier">:version</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">number</span> })
367
+ 200: <span class="ruby-keyword kw">end</span>
368
+ </pre>
369
+ </div>
370
+ </div>
371
+ </div>
372
+
373
+ <div id="method-M000330" class="method-detail">
374
+ <a name="M000330"></a>
375
+
376
+ <div class="method-heading">
377
+ <a href="#M000330" class="method-signature">
378
+ <span class="method-name">initialize_version</span><span class="method-args">()</span>
379
+ </a>
380
+ </div>
381
+
382
+ <div class="method-description">
383
+ <p><a class="source-toggle" href="#"
384
+ onclick="toggleCode('M000330-source');return false;">[Source]</a></p>
385
+ <div class="method-source-code" id="M000330-source">
386
+ <pre>
387
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 72</span>
388
+ 72: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_version</span>
389
+ 73: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span> = <span class="ruby-value">1</span>
390
+ 74: <span class="ruby-keyword kw">end</span>
391
+ </pre>
392
+ </div>
393
+ </div>
394
+ </div>
395
+
396
+ <div id="method-M000338" class="method-detail">
397
+ <a name="M000338"></a>
398
+
399
+ <div class="method-heading">
400
+ <a href="#M000338" class="method-signature">
401
+ <span class="method-name">live_version</span><span class="method-args">()</span>
402
+ </a>
403
+ </div>
404
+
405
+ <div class="method-description">
406
+ <p><a class="source-toggle" href="#"
407
+ onclick="toggleCode('M000338-source');return false;">[Source]</a></p>
408
+ <div class="method-source-code" id="M000338-source">
409
+ <pre>
410
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 186</span>
411
+ 186: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">live_version</span>
412
+ 187: <span class="ruby-identifier">find_version</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">id</span>).<span class="ruby-identifier">version</span>)
413
+ 188: <span class="ruby-keyword kw">end</span>
414
+ </pre>
415
+ </div>
416
+ </div>
417
+ </div>
418
+
419
+ <div id="method-M000339" class="method-detail">
420
+ <a name="M000339"></a>
421
+
422
+ <div class="method-heading">
423
+ <a href="#M000339" class="method-signature">
424
+ <span class="method-name">live_version?</span><span class="method-args">()</span>
425
+ </a>
426
+ </div>
427
+
428
+ <div class="method-description">
429
+ <p><a class="source-toggle" href="#"
430
+ onclick="toggleCode('M000339-source');return false;">[Source]</a></p>
431
+ <div class="method-source-code" id="M000339-source">
432
+ <pre>
433
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 190</span>
434
+ 190: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">live_version?</span>
435
+ 191: <span class="ruby-identifier">version</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">id</span>).<span class="ruby-identifier">version</span>
436
+ 192: <span class="ruby-keyword kw">end</span>
437
+ </pre>
438
+ </div>
439
+ </div>
440
+ </div>
441
+
442
+ <div id="method-M000344" class="method-detail">
443
+ <a name="M000344"></a>
444
+
445
+ <div class="method-heading">
446
+ <a href="#M000344" class="method-signature">
447
+ <span class="method-name">revert</span><span class="method-args">()</span>
448
+ </a>
449
+ </div>
450
+
451
+ <div class="method-description">
452
+ <p><a class="source-toggle" href="#"
453
+ onclick="toggleCode('M000344-source');return false;">[Source]</a></p>
454
+ <div class="method-source-code" id="M000344-source">
455
+ <pre>
456
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 231</span>
457
+ 231: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">revert</span>
458
+ 232: <span class="ruby-identifier">draft_version</span> = <span class="ruby-identifier">draft</span>.<span class="ruby-identifier">version</span>
459
+ 233: <span class="ruby-identifier">revert_to</span>(<span class="ruby-identifier">draft_version</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">draft_version</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
460
+ 234: <span class="ruby-keyword kw">end</span>
461
+ </pre>
462
+ </div>
463
+ </div>
464
+ </div>
465
+
466
+ <div id="method-M000346" class="method-detail">
467
+ <a name="M000346"></a>
468
+
469
+ <div class="method-heading">
470
+ <a href="#M000346" class="method-signature">
471
+ <span class="method-name">revert_to</span><span class="method-args">(version)</span>
472
+ </a>
473
+ </div>
474
+
475
+ <div class="method-description">
476
+ <p><a class="source-toggle" href="#"
477
+ onclick="toggleCode('M000346-source');return false;">[Source]</a></p>
478
+ <div class="method-source-code" id="M000346-source">
479
+ <pre>
480
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 247</span>
481
+ 247: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">revert_to</span>(<span class="ruby-identifier">version</span>)
482
+ 248: <span class="ruby-identifier">revert_to_without_save</span>(<span class="ruby-identifier">version</span>)
483
+ 249: <span class="ruby-identifier">save</span>
484
+ 250: <span class="ruby-keyword kw">end</span>
485
+ </pre>
486
+ </div>
487
+ </div>
488
+ </div>
489
+
490
+ <div id="method-M000345" class="method-detail">
491
+ <a name="M000345"></a>
492
+
493
+ <div class="method-heading">
494
+ <a href="#M000345" class="method-signature">
495
+ <span class="method-name">revert_to_without_save</span><span class="method-args">(version)</span>
496
+ </a>
497
+ </div>
498
+
499
+ <div class="method-description">
500
+ <p><a class="source-toggle" href="#"
501
+ onclick="toggleCode('M000345-source');return false;">[Source]</a></p>
502
+ <div class="method-source-code" id="M000345-source">
503
+ <pre>
504
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 236</span>
505
+ 236: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">revert_to_without_save</span>(<span class="ruby-identifier">version</span>)
506
+ 237: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Version parameter missing&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">version</span>.<span class="ruby-identifier">blank?</span>
507
+ 238: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">revert_to_version</span> = <span class="ruby-identifier">find_version</span>(<span class="ruby-identifier">version</span>)
508
+ 239: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Could not find version #{version}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">revert_to_version</span>
509
+ 240: (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">versioned_columns</span> <span class="ruby-operator">-</span> [<span class="ruby-value str">&quot;version&quot;</span>]).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
510
+ 241: <span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{a}=&quot;</span>, <span class="ruby-identifier">revert_to_version</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">a</span>))
511
+ 242: <span class="ruby-keyword kw">end</span>
512
+ 243: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version_comment</span> = <span class="ruby-node">&quot;Reverted to version #{version}&quot;</span>
513
+ 244: <span class="ruby-keyword kw">self</span>
514
+ 245: <span class="ruby-keyword kw">end</span>
515
+ </pre>
516
+ </div>
517
+ </div>
518
+ </div>
519
+
520
+ <div id="method-M000334" class="method-detail">
521
+ <a name="M000334"></a>
522
+
523
+ <div class="method-heading">
524
+ <a href="#M000334" class="method-signature">
525
+ <span class="method-name">save</span><span class="method-args">(perform_validations=true)</span>
526
+ </a>
527
+ </div>
528
+
529
+ <div class="method-description">
530
+ <p><a class="source-toggle" href="#"
531
+ onclick="toggleCode('M000334-source');return false;">[Source]</a></p>
532
+ <div class="method-source-code" id="M000334-source">
533
+ <pre>
534
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 110</span>
535
+ 110: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save</span>(<span class="ruby-identifier">perform_validations</span>=<span class="ruby-keyword kw">true</span>)
536
+ 111: <span class="ruby-identifier">transaction</span> <span class="ruby-keyword kw">do</span>
537
+ 112: <span class="ruby-comment cmt">#logger.info &quot;..... Calling valid?&quot;</span>
538
+ 113: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid?</span>
539
+ 114:
540
+ 115: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">changed?</span>
541
+ 116: <span class="ruby-comment cmt">#logger.info &quot;..... Changes =&gt; #{changes.inspect}&quot;</span>
542
+ 117: <span class="ruby-keyword kw">else</span>
543
+ 118: <span class="ruby-comment cmt">#logger.info &quot;..... No Changes&quot;</span>
544
+ 119: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
545
+ 120: <span class="ruby-keyword kw">end</span>
546
+ 121:
547
+ 122: <span class="ruby-comment cmt">#logger.info &quot;..... Calling before_save&quot;</span>
548
+ 123: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">callback</span>(<span class="ruby-identifier">:before_save</span>) <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
549
+ 124:
550
+ 125: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">new_record?</span>
551
+ 126: <span class="ruby-comment cmt">#logger.info &quot;..... Calling before_create&quot;</span>
552
+ 127: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">callback</span>(<span class="ruby-identifier">:before_create</span>) <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
553
+ 128: <span class="ruby-keyword kw">else</span>
554
+ 129: <span class="ruby-comment cmt">#logger.info &quot;..... Calling before_update&quot;</span>
555
+ 130: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">callback</span>(<span class="ruby-identifier">:before_update</span>) <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
556
+ 131: <span class="ruby-keyword kw">end</span>
557
+ 132:
558
+ 133: <span class="ruby-comment cmt">#logger.info &quot;..... Calling build_new_version&quot;</span>
559
+ 134: <span class="ruby-identifier">new_version</span> = <span class="ruby-identifier">build_new_version</span>
560
+ 135: <span class="ruby-comment cmt">#logger.info &quot;..... Is new version valid? #{new_version.valid?}&quot;</span>
561
+ 136: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">new_record?</span>
562
+ 137: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span> = <span class="ruby-value">1</span>
563
+ 138: <span class="ruby-comment cmt">#logger.info &quot;..... Calling create_without_callbacks&quot;</span>
564
+ 139: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span> = <span class="ruby-identifier">create_without_callbacks</span>
565
+ 140: <span class="ruby-comment cmt">#logger.info &quot;..... Calling after_create&quot;</span>
566
+ 141: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">callback</span>(<span class="ruby-identifier">:after_create</span>) <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">false</span>
567
+ 142: <span class="ruby-comment cmt">#logger.info &quot;..... Calling after_save&quot;</span>
568
+ 143: <span class="ruby-identifier">callback</span>(<span class="ruby-identifier">:after_save</span>)
569
+ 144: <span class="ruby-keyword kw">end</span>
570
+ 145:
571
+ 146: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@publish_on_save</span>
572
+ 147: <span class="ruby-identifier">publish</span>
573
+ 148: <span class="ruby-ivar">@publish_on_save</span> = <span class="ruby-keyword kw">nil</span>
574
+ 149: <span class="ruby-keyword kw">end</span>
575
+ 150: <span class="ruby-identifier">changed_attributes</span>.<span class="ruby-identifier">clear</span>
576
+ 151: <span class="ruby-keyword kw">end</span>
577
+ 152: <span class="ruby-identifier">result</span>
578
+ 153: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">new_version</span>
579
+ 154: <span class="ruby-comment cmt">#logger.info &quot;..... Calling save&quot;</span>
580
+ 155: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span> = <span class="ruby-identifier">new_version</span>.<span class="ruby-identifier">save</span>
581
+ 156: <span class="ruby-comment cmt">#logger.info &quot;..... Calling after_save&quot;</span>
582
+ 157: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">callback</span>(<span class="ruby-identifier">:after_update</span>) <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">false</span>
583
+ 158: <span class="ruby-comment cmt">#logger.info &quot;..... Calling after_update&quot;</span>
584
+ 159: <span class="ruby-identifier">callback</span>(<span class="ruby-identifier">:after_save</span>)
585
+ 160: <span class="ruby-keyword kw">end</span>
586
+ 161:
587
+ 162: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@publish_on_save</span>
588
+ 163: <span class="ruby-identifier">publish</span>
589
+ 164: <span class="ruby-ivar">@publish_on_save</span> = <span class="ruby-keyword kw">nil</span>
590
+ 165: <span class="ruby-keyword kw">end</span>
591
+ 166: <span class="ruby-identifier">changed_attributes</span>.<span class="ruby-identifier">clear</span>
592
+ 167: <span class="ruby-keyword kw">end</span>
593
+ 168: <span class="ruby-identifier">result</span>
594
+ 169: <span class="ruby-keyword kw">end</span>
595
+ 170: <span class="ruby-keyword kw">true</span>
596
+ 171: <span class="ruby-keyword kw">end</span>
597
+ 172: <span class="ruby-keyword kw">end</span>
598
+ </pre>
599
+ </div>
600
+ </div>
601
+ </div>
602
+
603
+ <div id="method-M000335" class="method-detail">
604
+ <a name="M000335"></a>
605
+
606
+ <div class="method-heading">
607
+ <a href="#M000335" class="method-signature">
608
+ <span class="method-name">save!</span><span class="method-args">(perform_validations=true)</span>
609
+ </a>
610
+ </div>
611
+
612
+ <div class="method-description">
613
+ <p><a class="source-toggle" href="#"
614
+ onclick="toggleCode('M000335-source');return false;">[Source]</a></p>
615
+ <div class="method-source-code" id="M000335-source">
616
+ <pre>
617
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 174</span>
618
+ 174: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save!</span>(<span class="ruby-identifier">perform_validations</span>=<span class="ruby-keyword kw">true</span>)
619
+ 175: <span class="ruby-identifier">save</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">raise</span>(<span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">RecordNotSaved</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">full_messages</span>))
620
+ 176: <span class="ruby-keyword kw">end</span>
621
+ </pre>
622
+ </div>
623
+ </div>
624
+ </div>
625
+
626
+ <div id="method-M000347" class="method-detail">
627
+ <a name="M000347"></a>
628
+
629
+ <div class="method-heading">
630
+ <a href="#M000347" class="method-signature">
631
+ <span class="method-name">version_comment</span><span class="method-args">()</span>
632
+ </a>
633
+ </div>
634
+
635
+ <div class="method-description">
636
+ <p><a class="source-toggle" href="#"
637
+ onclick="toggleCode('M000347-source');return false;">[Source]</a></p>
638
+ <div class="method-source-code" id="M000347-source">
639
+ <pre>
640
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 252</span>
641
+ 252: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">version_comment</span>
642
+ 253: <span class="ruby-ivar">@version_comment</span>
643
+ 254: <span class="ruby-keyword kw">end</span>
644
+ </pre>
645
+ </div>
646
+ </div>
647
+ </div>
648
+
649
+ <div id="method-M000348" class="method-detail">
650
+ <a name="M000348"></a>
651
+
652
+ <div class="method-heading">
653
+ <a href="#M000348" class="method-signature">
654
+ <span class="method-name">version_comment=</span><span class="method-args">(version_comment)</span>
655
+ </a>
656
+ </div>
657
+
658
+ <div class="method-description">
659
+ <p><a class="source-toggle" href="#"
660
+ onclick="toggleCode('M000348-source');return false;">[Source]</a></p>
661
+ <div class="method-source-code" id="M000348-source">
662
+ <pre>
663
+ <span class="ruby-comment cmt"># File lib/cms/behaviors/versioning.rb, line 256</span>
664
+ 256: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">version_comment=</span>(<span class="ruby-identifier">version_comment</span>)
665
+ 257: <span class="ruby-ivar">@version_comment</span> = <span class="ruby-identifier">version_comment</span>
666
+ 258: <span class="ruby-identifier">send</span>(<span class="ruby-identifier">:changed_attributes</span>)[<span class="ruby-value str">&quot;version_comment&quot;</span>] = <span class="ruby-ivar">@version_comment</span>
667
+ 259: <span class="ruby-keyword kw">end</span>
668
+ </pre>
669
+ </div>
670
+ </div>
671
+ </div>
672
+
673
+
674
+ </div>
675
+
676
+
677
+ </div>
678
+
679
+
680
+ <div id="validator-badges">
681
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
682
+ </div>
683
+
684
+ </body>
685
+ </html>