zen 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. data/.gems +17 -15
  2. data/.gitignore +1 -1
  3. data/.travis.yml +1 -1
  4. data/MANIFEST +470 -0
  5. data/README.md +5 -3
  6. data/Rakefile +8 -6
  7. data/bin/zen +2 -7
  8. data/guide/asset_management.md +1 -0
  9. data/guide/autosaving_forms.md +1 -0
  10. data/guide/changelog.md +22 -0
  11. data/guide/faq.md +1 -0
  12. data/guide/getting_started.md +1 -0
  13. data/guide/hacking.md +1 -0
  14. data/guide/images/sections/revisions.png +0 -0
  15. data/guide/images/sections/revisions_diff.png +0 -0
  16. data/guide/images/sections/revisions_diff_multiple.png +0 -0
  17. data/guide/installation.md +4 -3
  18. data/guide/javascript.md +1 -0
  19. data/guide/javascript/zen_autosave.md +1 -0
  20. data/guide/javascript/zen_editor.md +1 -0
  21. data/guide/javascript/zen_form.md +1 -0
  22. data/guide/javascript/zen_hash.md +1 -0
  23. data/guide/javascript/zen_htmltable.md +1 -0
  24. data/guide/javascript/zen_tabs.md +1 -0
  25. data/guide/javascript/zen_window.md +1 -0
  26. data/guide/zen_compared.md +1 -0
  27. data/lib/zen.rb +10 -12
  28. data/lib/zen/event.rb +2 -2
  29. data/lib/zen/helper/controller.rb +13 -13
  30. data/lib/zen/helper/message.rb +3 -3
  31. data/lib/zen/helper/search.rb +4 -4
  32. data/lib/zen/helper/stacked_aspect.rb +9 -9
  33. data/lib/zen/html_diff.rb +151 -0
  34. data/lib/zen/language.rb +9 -7
  35. data/lib/zen/language/translation.rb +8 -8
  36. data/lib/zen/markup.rb +1 -1
  37. data/lib/zen/migrator.rb +2 -2
  38. data/lib/zen/model/helper.rb +4 -4
  39. data/lib/zen/model/plugin/events.rb +16 -16
  40. data/lib/zen/package.rb +2 -2
  41. data/lib/zen/package/all.rb +1 -1
  42. data/lib/zen/package/categories/lib/categories/controller/categories.rb +4 -4
  43. data/lib/zen/package/categories/lib/categories/controller/category_groups.rb +4 -4
  44. data/lib/zen/package/categories/lib/categories/helper/category.rb +3 -3
  45. data/lib/zen/package/categories/lib/categories/model/category.rb +9 -9
  46. data/lib/zen/package/categories/lib/categories/model/category_group.rb +9 -9
  47. data/lib/zen/package/comments/lib/comments/controller/comments.rb +4 -4
  48. data/lib/zen/package/comments/lib/comments/controller/comments_form.rb +2 -2
  49. data/lib/zen/package/comments/lib/comments/helper/comment.rb +1 -1
  50. data/lib/zen/package/comments/lib/comments/model/comment.rb +13 -13
  51. data/lib/zen/package/custom_fields/lib/custom_fields/blue_form_parameters.rb +1 -1
  52. data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_groups.rb +4 -4
  53. data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_types.rb +6 -6
  54. data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_fields.rb +5 -5
  55. data/lib/zen/package/custom_fields/lib/custom_fields/helper/custom_field.rb +3 -3
  56. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field.rb +9 -9
  57. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_group.rb +9 -9
  58. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_type.rb +9 -9
  59. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_value.rb +8 -3
  60. data/lib/zen/package/custom_fields/migrations/1336171490_revisions.rb +41 -0
  61. data/lib/zen/package/dashboard/lib/dashboard/controller/dashboard.rb +6 -6
  62. data/lib/zen/package/dashboard/lib/dashboard/model/widget.rb +3 -3
  63. data/lib/zen/package/dashboard/lib/dashboard/widget.rb +12 -12
  64. data/lib/zen/package/extensions/lib/extensions/controller/extensions.rb +3 -3
  65. data/lib/zen/package/menus/lib/menus/controller/menu_items.rb +5 -5
  66. data/lib/zen/package/menus/lib/menus/controller/menus.rb +4 -4
  67. data/lib/zen/package/menus/lib/menus/helper/menu.rb +4 -4
  68. data/lib/zen/package/menus/lib/menus/model/menu.rb +11 -11
  69. data/lib/zen/package/menus/lib/menus/model/menu_item.rb +10 -10
  70. data/lib/zen/package/menus/lib/menus/public/admin/menus/js/lib/nested_sortables.js +13 -13
  71. data/lib/zen/package/menus/lib/menus/public/admin/menus/js/menu_items.js +1 -1
  72. data/lib/zen/package/sections/lib/sections.rb +19 -0
  73. data/lib/zen/package/sections/lib/sections/controller/revisions.rb +184 -0
  74. data/lib/zen/package/sections/lib/sections/controller/section_entries.rb +5 -5
  75. data/lib/zen/package/sections/lib/sections/controller/sections.rb +9 -6
  76. data/lib/zen/package/sections/lib/sections/helper/revision.rb +124 -0
  77. data/lib/zen/package/sections/lib/sections/helper/section.rb +17 -15
  78. data/lib/zen/package/sections/lib/sections/helper/section_frontend.rb +104 -6
  79. data/lib/zen/package/sections/lib/sections/language/en/revisions.rb +34 -0
  80. data/lib/zen/package/sections/lib/sections/language/en/sections.rb +1 -0
  81. data/lib/zen/package/sections/lib/sections/language/nl/revisions.rb +35 -0
  82. data/lib/zen/package/sections/lib/sections/language/nl/sections.rb +1 -0
  83. data/lib/zen/package/sections/lib/sections/model/revision.rb +76 -0
  84. data/lib/zen/package/sections/lib/sections/model/section.rb +9 -9
  85. data/lib/zen/package/sections/lib/sections/model/section_entry.rb +47 -12
  86. data/lib/zen/package/sections/lib/sections/view/admin/revisions/index.xhtml +89 -0
  87. data/lib/zen/package/sections/lib/sections/view/admin/section-entries/form.xhtml +1 -1
  88. data/lib/zen/package/sections/lib/sections/view/admin/section-entries/index.xhtml +14 -0
  89. data/lib/zen/package/sections/migrations/1335711557_revisions.rb +40 -0
  90. data/lib/zen/package/settings/lib/settings/controller/settings.rb +12 -4
  91. data/lib/zen/package/settings/lib/settings/setting.rb +6 -6
  92. data/lib/zen/package/users/lib/users/controller/user_groups.rb +4 -4
  93. data/lib/zen/package/users/lib/users/controller/users.rb +12 -12
  94. data/lib/zen/package/users/lib/users/helper/access.rb +1 -1
  95. data/lib/zen/package/users/lib/users/helper/acl.rb +4 -4
  96. data/lib/zen/package/users/lib/users/helper/users.rb +2 -2
  97. data/lib/zen/package/users/lib/users/model/permission.rb +1 -1
  98. data/lib/zen/package/users/lib/users/model/user.rb +11 -11
  99. data/lib/zen/package/users/lib/users/model/user_group.rb +9 -9
  100. data/lib/zen/package/users/lib/users/model/user_status.rb +2 -2
  101. data/lib/zen/public/admin/zen/css/general.css +54 -0
  102. data/lib/zen/public/admin/zen/css/messages.css +6 -3
  103. data/lib/zen/public/admin/zen/css/tables.css +10 -0
  104. data/lib/zen/public/admin/zen/images/icons/undo.png +0 -0
  105. data/lib/zen/public/admin/zen/js/lib/autosave.js +8 -8
  106. data/lib/zen/public/admin/zen/js/lib/base.js +2 -2
  107. data/lib/zen/public/admin/zen/js/lib/events.js +2 -2
  108. data/lib/zen/public/admin/zen/js/lib/form.js +7 -7
  109. data/lib/zen/public/admin/zen/js/lib/hash.js +7 -7
  110. data/lib/zen/public/admin/zen/js/lib/tabs.js +3 -3
  111. data/lib/zen/public/admin/zen/js/lib/window.js +1 -1
  112. data/lib/zen/security.rb +2 -2
  113. data/lib/zen/spec/helper.rb +3 -9
  114. data/lib/zen/spec/helper/capybara.rb +4 -4
  115. data/lib/zen/spec/helper/general.rb +1 -1
  116. data/lib/zen/spec/simplecov.rb +1 -5
  117. data/lib/zen/task/build.rake +22 -16
  118. data/lib/zen/task/db.rake +3 -2
  119. data/lib/zen/task/spelling.rake +10 -10
  120. data/lib/zen/task/test.rake +27 -19
  121. data/lib/zen/theme.rb +6 -6
  122. data/lib/zen/version.rb +1 -1
  123. data/spec/zen/all.rb +4 -0
  124. data/spec/zen/package/sections/controller/revisions.rb +235 -0
  125. data/spec/zen/package/sections/model/revision.rb +76 -0
  126. data/zen.gemspec +23 -21
  127. metadata +88 -29
  128. data/lib/zen/model/methods.rb +0 -27
  129. data/lib/zen/task/clean.rake +0 -20
  130. data/lib/zen/task/setup.rake +0 -4
  131. data/pkg/.gitkeep +0 -0
@@ -279,7 +279,7 @@ module Zen
279
279
  ##
280
280
  # Creates a new instance of the package.
281
281
  #
282
- # @since 12-02-2012
282
+ # @since 2012-02-12
283
283
  #
284
284
  def initialize
285
285
  @env = OpenStruct.new
@@ -325,7 +325,7 @@ module Zen
325
325
  # Returns the title as either an ``<a>`` tag or plain text depending on
326
326
  # whether or not the package has a URL set.
327
327
  #
328
- # @since 19-11-2011
328
+ # @since 2011-11-19
329
329
  # @return [String]
330
330
  #
331
331
  def formatted_title
@@ -5,8 +5,8 @@ require __DIR__('settings/lib/settings')
5
5
  require __DIR__('users/lib/users')
6
6
  require __DIR__('dashboard/lib/dashboard')
7
7
  require __DIR__('sections/lib/sections')
8
+ require __DIR__('custom_fields/lib/custom_fields')
8
9
  require __DIR__('comments/lib/comments')
9
10
  require __DIR__('categories/lib/categories')
10
- require __DIR__('custom_fields/lib/custom_fields')
11
11
  require __DIR__('menus/lib/menus')
12
12
  require __DIR__('extensions/lib/extensions')
@@ -71,10 +71,10 @@ module Categories
71
71
  #
72
72
  # This controller uses the following permissions:
73
73
  #
74
- # * show_category
75
- # * edit_category
76
- # * new_category
77
- # * delete_category
74
+ # * show\_category
75
+ # * edit\_category
76
+ # * new\_category
77
+ # * delete\_category
78
78
  #
79
79
  # @since 0.1
80
80
  # @map /admin/categories
@@ -82,10 +82,10 @@ module Categories
82
82
  #
83
83
  # ## Used Permissions
84
84
  #
85
- # * show_category_group
86
- # * edit_category_group
87
- # * new_category_group
88
- # * delete_category_group
85
+ # * show\_category\_group
86
+ # * edit\_category\_group
87
+ # * new\_category\_group
88
+ # * delete\_category\_group
89
89
  #
90
90
  # @since 0.1
91
91
  # @map /admin/category-groups
@@ -64,7 +64,7 @@ module Ramaze
64
64
  # category group ID.
65
65
  #
66
66
  # @since 0.2.8
67
- # @param [Fixnum[ category_id The ID of the category, this one will be
67
+ # @param [Fixnum] category_id The ID of the category, this one will be
68
68
  # excluded from the hash.
69
69
  # @param [Fixnum] category_group_id The ID of a category group for which
70
70
  # to retrieve all the possible parent items.
@@ -87,7 +87,7 @@ module Ramaze
87
87
  # Redirects the user to the category groups overview and shows a message
88
88
  # about an invalid group being specified.
89
89
  #
90
- # @since 03-04-2012
90
+ # @since 2012-04-03
91
91
  #
92
92
  def redirect_invalid_group
93
93
  message(:error, lang('category_groups.errors.invalid_group'))
@@ -99,7 +99,7 @@ module Ramaze
99
99
  # and shows a message informing the user that the specified category was
100
100
  # invalid.
101
101
  #
102
- # @since 03-04-2012
102
+ # @since 2012-04-03
103
103
  # @param [Fixnum] category_group_id The ID of the category group that the
104
104
  # category belongs to.
105
105
  #
@@ -30,12 +30,12 @@ module Categories
30
30
  # end
31
31
  #
32
32
  # @since 0.1
33
- # @event before_new_category
34
- # @event after_new_category
35
- # @event before_edit_category
36
- # @event after_edit_category
37
- # @event before_delete_category
38
- # @event after_delete_category
33
+ # @event before\_new\_category
34
+ # @event after\_new\_category
35
+ # @event before\_edit\_category
36
+ # @event after\_edit\_category
37
+ # @event before\_delete\_category
38
+ # @event after\_delete\_category
39
39
  #
40
40
  class Category < Sequel::Model
41
41
  include Zen::Model::Helper
@@ -43,7 +43,7 @@ module Categories
43
43
  ##
44
44
  # Array containing the column names that can be set by the user.
45
45
  #
46
- # @since 17-02-2012
46
+ # @since 2012-02-17
47
47
  #
48
48
  COLUMNS = [:parent_id, :name, :description, :slug, :category_group_id]
49
49
 
@@ -63,7 +63,7 @@ module Categories
63
63
  ##
64
64
  # Searches for a set of category groups using the specified search query.
65
65
  #
66
- # @since 16-10-2011
66
+ # @since 2011-10-16
67
67
  # @param [String] query The search query.
68
68
  # @return [Mixed]
69
69
  #
@@ -85,7 +85,7 @@ module Categories
85
85
  ##
86
86
  # Hook that is executed before creating or saving an object.
87
87
  #
88
- # @since 03-01-2012
88
+ # @since 2012-01-03
89
89
  #
90
90
  def before_save
91
91
  sanitize_fields([:name, :slug, :description])
@@ -31,12 +31,12 @@ module Categories
31
31
  # end
32
32
  #
33
33
  # @since 0.1
34
- # @event before_new_category_group
35
- # @event after_new_category_group
36
- # @event before_edit_category_group
37
- # @event after_edit_category_group
38
- # @event before_delete_category_group
39
- # @event after_delete_category_group
34
+ # @event before\_new\_category\_group
35
+ # @event after\_new\_category\_group
36
+ # @event before\_edit\_category\_group
37
+ # @event after\_edit\_category\_group
38
+ # @event before\_delete\_category\_group
39
+ # @event after\_delete\_category\_group
40
40
  #
41
41
  class CategoryGroup < Sequel::Model
42
42
  include Zen::Model::Helper
@@ -44,7 +44,7 @@ module Categories
44
44
  ##
45
45
  # Array containing the column names that can be set by the user.
46
46
  #
47
- # @since 17-02-2012
47
+ # @since 2012-02-17
48
48
  #
49
49
  COLUMNS = [:name, :description]
50
50
 
@@ -64,7 +64,7 @@ module Categories
64
64
  ##
65
65
  # Searches for a set of category groups using the specified search query.
66
66
  #
67
- # @since 16-10-2011
67
+ # @since 2011-10-16
68
68
  # @param [String] query The search query.
69
69
  # @return [Mixed]
70
70
  #
@@ -85,7 +85,7 @@ module Categories
85
85
  ##
86
86
  # Hook that is run before creating or saving an object.
87
87
  #
88
- # @since 03-01-2012
88
+ # @since 2012-01-03
89
89
  #
90
90
  def before_save
91
91
  sanitize_fields([:name, :description])
@@ -117,10 +117,10 @@ module Comments
117
117
  #
118
118
  # This controller uses the following permissions:
119
119
  #
120
- # * show_comment
121
- # * edit_comment
122
- # * new_comment
123
- # * delete_comment
120
+ # * show\_comment
121
+ # * edit\_comment
122
+ # * new\_comment
123
+ # * delete\_comment
124
124
  #
125
125
  # @since 0.1
126
126
  # @map /admin/comments
@@ -86,8 +86,8 @@ module Comments
86
86
  # two objects in the flash just like the backend controllers. These are the
87
87
  # following two items:
88
88
  #
89
- # * **form_data**: an instance of {Comments::Model::Comment}
90
- # * **form_errros**: a hash containing all errors, automatically used by
89
+ # * **form\_data**: an instance of {Comments::Model::Comment}
90
+ # * **form\_errros**: a hash containing all errors, automatically used by
91
91
  # ``Ramaze::Helper::BlueForm`` if the form was created using the
92
92
  # ``form_for()`` method.
93
93
  #
@@ -33,7 +33,7 @@ module Ramaze
33
33
  # Redirects the user to the comments overview and shows a message
34
34
  # informing the user that the comment he/she tried to access was invalid.
35
35
  #
36
- # @since 05-04-2012
36
+ # @since 2012-04-05
37
37
  #
38
38
  def redirect_invalid_comment
39
39
  message(:error, lang('comments.errors.invalid_comment'))
@@ -32,12 +32,12 @@ module Comments
32
32
  # end
33
33
  #
34
34
  # @since 0.1
35
- # @event before_new_comment
36
- # @event after_new_comment
37
- # @event before_edit_comment
38
- # @event after_edit_comment
39
- # @event beore_delete_comment
40
- # @event after_delete_comment
35
+ # @event before\_new\_comment
36
+ # @event after\_new\_comment
37
+ # @event before\_edit\_comment
38
+ # @event after\_edit\_comment
39
+ # @event beore\_delete\_comment
40
+ # @event after\_delete\_comment
41
41
  #
42
42
  class Comment < Sequel::Model
43
43
  include Zen::Model::Helper
@@ -45,7 +45,7 @@ module Comments
45
45
  ##
46
46
  # Array containing all the columns that can be set by the user.
47
47
  #
48
- # @since 17-02-2012
48
+ # @since 2012-02-17
49
49
  #
50
50
  COLUMNS = [
51
51
  :user_id, :name, :website, :email, :comment, :comment_status_id,
@@ -79,7 +79,7 @@ module Comments
79
79
  # * users.email
80
80
  # * users.name
81
81
  #
82
- # @since 16-10-2011
82
+ # @since 2011-10-16
83
83
  # @param [String] query The search query.
84
84
  # @return [Array]
85
85
  #
@@ -155,7 +155,7 @@ module Comments
155
155
  # retrieved from the current comment row or from an associated user
156
156
  # object.
157
157
  #
158
- # @since 16-10-2011
158
+ # @since 2011-10-16
159
159
  # @return [String]
160
160
  #
161
161
  def user_name
@@ -169,7 +169,7 @@ module Comments
169
169
  ##
170
170
  # Gets the Email address of the author of the comment.
171
171
  #
172
- # @since 16-10-2011
172
+ # @since 2011-10-16
173
173
  # @return [String]
174
174
  #
175
175
  def user_email
@@ -184,7 +184,7 @@ module Comments
184
184
  # Gets the website of the author of the comment and optionally creates an
185
185
  # anchor tag for it.
186
186
  #
187
- # @since 16-10-2011
187
+ # @since 2011-10-16
188
188
  # @param [TrueClass|FalseClass] with_link When set to true the website
189
189
  # will be returned as an ``<a>`` tag.
190
190
  # @param [String] text The alternative text to use for the link tag.
@@ -213,7 +213,7 @@ module Comments
213
213
  # Returns the first 15 characters of a comment, optionally wrapped in a
214
214
  # link that points to the form to edit the comment.
215
215
  #
216
- # @since 17-10-2011
216
+ # @since 2011-10-17
217
217
  # @param [TrueClass|FalseClass] with_link When set to true the comment
218
218
  # will be wrapped in an ``<a>`` tag.
219
219
  # @return [String]
@@ -249,7 +249,7 @@ module Comments
249
249
  ##
250
250
  # Returns the name of the comment status.
251
251
  #
252
- # @since 17-10-2011
252
+ # @since 2011-10-17
253
253
  # @return [String]
254
254
  #
255
255
  def status_name
@@ -273,7 +273,7 @@ module CustomFields
273
273
  # ``flash[:form_data]`` it will be retrieved from this hash, otherwise the
274
274
  # default value is used.
275
275
  #
276
- # @since 26-02-2012
276
+ # @since 2012-02-26
277
277
  # @param [String] name The name of the field.
278
278
  # @param [Mixed] value The default value.
279
279
  # @return [Mixed]
@@ -75,10 +75,10 @@ module CustomFields
75
75
  #
76
76
  # ## Used Permissions
77
77
  #
78
- # * show_custom_field_group
79
- # * new_custom_field_group
80
- # * edit_custom_field_group
81
- # * delete_custom_field_group
78
+ # * show\_custom\_field\_group
79
+ # * new\_custom\_field\_group
80
+ # * edit\_custom\_field\_group
81
+ # * delete\_custom\_field\_group
82
82
  #
83
83
  # @since 0.1
84
84
  # @map /admin/custom-field-groups
@@ -99,10 +99,10 @@ module CustomFields
99
99
  #
100
100
  # ## Used Permissions
101
101
  #
102
- # * show_custom_field_type
103
- # * edit_custom_field_type
104
- # * new_custom_field_type
105
- # * delete_custom_field_type
102
+ # * show\_custom\_field\_type
103
+ # * edit\_custom\_field\_type
104
+ # * new\_custom\_field\_type
105
+ # * delete\_custom\_field\_type
106
106
  #
107
107
  # @since 0.2.8
108
108
  # @map /admin/custom-field-types
@@ -165,7 +165,7 @@ module CustomFields
165
165
  )
166
166
 
167
167
  @custom_field_type = validate_custom_field_type(id)
168
- @custom_field_methods = Model::CustomFieldMethod.pk_hash(:name)
168
+ @custom_field_methods = Model::CustomFieldMethod.to_hash(:id, :name)
169
169
 
170
170
  @custom_field_type.set(flash[:form_data]) if flash[:form_data]
171
171
 
@@ -186,7 +186,7 @@ module CustomFields
186
186
  lang('custom_field_types.titles.new')
187
187
  )
188
188
 
189
- @custom_field_methods = Model::CustomFieldMethod.pk_hash(:name)
189
+ @custom_field_methods = Model::CustomFieldMethod.to_hash(:id, :name)
190
190
  @custom_field_type = Model::CustomFieldType.new
191
191
 
192
192
  @custom_field_type.set(flash[:form_data]) if flash[:form_data]
@@ -133,10 +133,10 @@ module CustomFields
133
133
  #
134
134
  # ## Used Permissions
135
135
  #
136
- # * show_custom_field
137
- # * new_custom_field
138
- # * edit_custom_field
139
- # * delete_custom_field
136
+ # * show\_custom\_field
137
+ # * new\_custom\_field
138
+ # * edit\_custom\_field
139
+ # * delete\_custom\_field
140
140
  #
141
141
  # @since 0.1
142
142
  # @map /admin/custom-fields
@@ -197,7 +197,7 @@ module CustomFields
197
197
  ##
198
198
  # Show a form that lets the user edit an existing custom field group.
199
199
  #
200
- # @param [Fixnum] id The ID of the custom field
200
+ # @param [Fixnum] custom_field_group_id The ID of the custom field
201
201
  # group to which all fields belong.
202
202
  # @param [Fixnum] id The ID of the custom field to retrieve so that we
203
203
  # can edit it.
@@ -74,7 +74,7 @@ module Ramaze
74
74
  # Redirects the user back to the field groups overview and shows a message
75
75
  # informing the user that the group he/she tried to access was invalid.
76
76
  #
77
- # @since 05-04-2012
77
+ # @since 2012-04-05
78
78
  #
79
79
  def redirect_invalid_field_group
80
80
  message(:error, lang('custom_field_groups.errors.invalid_group'))
@@ -85,7 +85,7 @@ module Ramaze
85
85
  # Redirects the user to the custom field types overview and informs
86
86
  # him/her that the type he/she tried to access was invalid.
87
87
  #
88
- # @since 05-04-2012
88
+ # @since 2012-04-05
89
89
  #
90
90
  def redirect_invalid_field_type
91
91
  message(:error, lang('custom_field_types.errors.invalid_type'))
@@ -96,7 +96,7 @@ module Ramaze
96
96
  # Redirects the user to the overview of all custom fields of a given group
97
97
  # and informs the user that the field he/she tried to access is invalid.
98
98
  #
99
- # @since 05-04-2012
99
+ # @since 2012-04-05
100
100
  # @param [Fixnum] custom_field_group_id The ID of the group to use for
101
101
  # redirecting the user.
102
102
  #
@@ -5,12 +5,12 @@ module CustomFields
5
5
  # Model for managing retrieving custom fields.
6
6
  #
7
7
  # @since 0.1
8
- # @event before_new_custom_field
9
- # @event after_new_custom_field
10
- # @event before_edit_custom_field
11
- # @event after_edit_custom_field
12
- # @event before_delete_custom_field
13
- # @event after_delete_custom_field
8
+ # @event before\_new\_custom\_field
9
+ # @event after\_new\_custom\_field
10
+ # @event before\_edit\_custom\_field
11
+ # @event after\_edit\_custom\_field
12
+ # @event before\_delete\_custom\_field
13
+ # @event after\_delete\_custom\_field
14
14
  #
15
15
  class CustomField < Sequel::Model
16
16
  include Zen::Model::Helper
@@ -18,7 +18,7 @@ module CustomFields
18
18
  ##
19
19
  # Array containing all the columns the user can set.
20
20
  #
21
- # @since 17-02-2012
21
+ # @since 2012-02-17
22
22
  #
23
23
  COLUMNS = [
24
24
  :name,
@@ -57,7 +57,7 @@ module CustomFields
57
57
  ##
58
58
  # Searches for a set of custom fields.
59
59
  #
60
- # @since 16-10-2011
60
+ # @since 2011-10-16
61
61
  # @param [String] query The search query.
62
62
  # @return [Mixed]
63
63
  #
@@ -96,7 +96,7 @@ module CustomFields
96
96
  ##
97
97
  # Hook that is executed before creating or saving an object.
98
98
  #
99
- # @since 03-01-2012
99
+ # @since 2012-01-03
100
100
  #
101
101
  def before_save
102
102
  sanitize_fields([:name, :slug, :description, :format])