rails_admin 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rails_admin might be problematic. Click here for more details.

Files changed (45) hide show
  1. data/README.md +60 -51
  2. data/Rakefile +0 -0
  3. data/app/assets/javascripts/rails_admin/ra.widgets.coffee +12 -11
  4. data/app/assets/javascripts/rails_admin/ui.js.coffee +0 -3
  5. data/app/helpers/rails_admin/application_helper.rb +2 -2
  6. data/app/helpers/rails_admin/form_builder.rb +9 -5
  7. data/lib/rails_admin/adapters/active_record.rb +3 -1
  8. data/lib/rails_admin/adapters/mongoid.rb +5 -3
  9. data/lib/rails_admin/config/actions/show_in_app.rb +0 -1
  10. data/lib/rails_admin/config/fields/types/hidden.rb +9 -3
  11. data/lib/rails_admin/extensions/history/history.rb +4 -3
  12. data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +2 -2
  13. data/lib/rails_admin/version.rb +1 -1
  14. data/spec/dummy_app/app/active_record/ball.rb +1 -0
  15. data/spec/dummy_app/app/active_record/category.rb +2 -0
  16. data/spec/dummy_app/app/active_record/cms/basic_page.rb +2 -0
  17. data/spec/dummy_app/app/active_record/comment.rb +2 -0
  18. data/spec/dummy_app/app/active_record/division.rb +5 -2
  19. data/spec/dummy_app/app/active_record/draft.rb +5 -3
  20. data/spec/dummy_app/app/active_record/fan.rb +2 -0
  21. data/spec/dummy_app/app/active_record/league.rb +3 -1
  22. data/spec/dummy_app/app/active_record/nested_field_test.rb +2 -1
  23. data/spec/dummy_app/app/active_record/player.rb +7 -7
  24. data/spec/dummy_app/app/active_record/team.rb +7 -5
  25. data/spec/dummy_app/app/active_record/user.rb +1 -1
  26. data/spec/dummy_app/app/mongoid/ball.rb +2 -0
  27. data/spec/dummy_app/app/mongoid/category.rb +2 -0
  28. data/spec/dummy_app/app/mongoid/cms/basic_page.rb +2 -0
  29. data/spec/dummy_app/app/mongoid/comment.rb +2 -0
  30. data/spec/dummy_app/app/mongoid/division.rb +3 -0
  31. data/spec/dummy_app/app/mongoid/draft.rb +2 -0
  32. data/spec/dummy_app/app/mongoid/fan.rb +2 -0
  33. data/spec/dummy_app/app/mongoid/league.rb +2 -0
  34. data/spec/dummy_app/app/mongoid/nested_field_test.rb +2 -2
  35. data/spec/dummy_app/app/mongoid/player.rb +3 -1
  36. data/spec/dummy_app/app/mongoid/team.rb +3 -1
  37. data/spec/dummy_app/app/mongoid/user.rb +2 -0
  38. data/spec/dummy_app/config/application.rb +1 -1
  39. data/spec/dummy_app/config/initializers/rails_admin.rb +0 -1
  40. data/spec/dummy_app/db/test.sqlite3 +0 -0
  41. data/spec/dummy_app/log/test.log +54065 -0
  42. data/spec/integration/history/rails_admin_history_spec.rb +17 -0
  43. data/spec/integration/rails_admin_spec.rb +13 -2
  44. data/spec/unit/abstract_model_spec.rb +17 -0
  45. metadata +6 -8
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # RailsAdmin [![Build Status](https://secure.travis-ci.org/sferik/rails_admin.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/sferik/rails_admin.png?travis)][gemnasium] [![Click here to lend your support to: RailsAdmin and make a donation at www.pledgie.com !](https://www.pledgie.com/campaigns/15917.png?skin_name=chrome)][pledgie]
1
+ # RailsAdmin [![Build Status](https://secure.travis-ci.org/sferik/rails_admin.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/sferik/rails_admin.png?travis)][gemnasium] [![Click here to lend your support to: RailsAdmin and make a donation at www.pledgie.com !](https://www.pledgie.com/campaigns/15917.png)][pledgie]
2
2
  RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data.
3
3
 
4
4
  [travis]: http://travis-ci.org/sferik/rails_admin
@@ -18,7 +18,7 @@ Hoeven][plukevdh], and [Rein Henrichs][reinh].
18
18
  [plukevdh]: https://github.com/plukevdh
19
19
  [reinh]: https://github.com/reinh
20
20
 
21
- ## <a name="features"></a>Features
21
+ ## Features
22
22
 
23
23
  * Display database tables
24
24
  * Create new data
@@ -35,14 +35,14 @@ Hoeven][plukevdh], and [Rein Henrichs][reinh].
35
35
  * ActiveRecord
36
36
  * Mongoid [new]
37
37
 
38
- ## <a name="demo"></a>Demo
38
+ ## Demo
39
39
 
40
40
  Take RailsAdmin for a [test drive][demo] with sample data. ([Source code.][dummy_app])
41
41
 
42
42
  [demo]: http://rails-admin-tb.herokuapp.com/
43
43
  [dummy_app]: https://github.com/bbenezech/dummy_app
44
44
 
45
- ## <a name="installation"></a>Installation
45
+ ## Installation
46
46
  In your `Gemfile`, add the following dependencies:
47
47
 
48
48
  gem 'fastercsv' # Only required on Ruby 1.8 and below
@@ -72,7 +72,7 @@ Optionally, you may wish to set up [Cancan](https://github.com/ryanb/cancan),
72
72
 
73
73
  More on that in the [Wiki](https://github.com/sferik/rails_admin/wiki)
74
74
 
75
- ## <a name="usage"></a>Usage
75
+ ## Usage
76
76
  Start the server:
77
77
 
78
78
  $ rails server
@@ -80,63 +80,79 @@ Start the server:
80
80
  You should now be able to administer your site at
81
81
  [http://localhost:3000/admin](http://localhost:3000/admin).
82
82
 
83
- ## <a name="configuration"></a>Configuration
83
+ ## Configuration
84
84
 
85
85
  All configuration documentation has moved to the wiki: https://github.com/sferik/rails_admin/wiki
86
86
 
87
- ## <a name="support"></a>Support
88
- Please see [list of known issues](https://github.com/sferik/rails_admin/wiki/Troubleshoot) first.
87
+ ## Screenshots
88
+ ![Dashboard view](https://github.com/sferik/rails_admin/raw/master/screenshots/dashboard.png "dashboard view")
89
+ ![Delete view](https://github.com/sferik/rails_admin/raw/master/screenshots/delete.png "delete view")
90
+ ![List view](https://github.com/sferik/rails_admin/raw/master/screenshots/list.png "list view")
91
+ ![Nested view](https://github.com/sferik/rails_admin/raw/master/screenshots/nested.png "nested view")
92
+ ![Polymophic edit view](https://github.com/sferik/rails_admin/raw/master/screenshots/polymorphic.png "polymorphic view")
93
+
94
+ ## Support
95
+ If you have a question, please check this README, the wiki, and the [list of
96
+ known issues][troubleshoot].
89
97
 
90
- If you have a question, please check this README, the wiki, and the list of known issues.
98
+ [troubleshoot]: https://github.com/sferik/rails_admin/wiki/Troubleshoot
91
99
 
92
100
  If you still have a question, you can ask the [official RailsAdmin mailing
93
- list](http://groups.google.com/group/rails_admin) or ping sferik on IRC in
94
- [#railsadmin on
95
- irc.freenode.net](http://webchat.freenode.net/?channels=railsadmin).
101
+ list][list].
102
+
103
+ [list]: http://groups.google.com/group/rails_admin
96
104
 
97
- If you think you found a bug in RailsAdmin, you can [submit an
98
- issue](https://github.com/sferik/rails_admin#issues).
99
- No feature requests or questions please (the mailing list is
100
- active and is the preferred venue for feature requests and questions).
105
+ If you think you found a bug in RailsAdmin, you can [submit an issue][issues].
101
106
 
102
- ## <a name="contributing"></a>Contributing
103
- In the spirit of [free software](http://www.fsf.org/licensing/essays/free-sw.html),
104
- **everyone** is encouraged to help improve this project.
107
+ ## Contributing
108
+ In the spirit of [free software][free-sw], **everyone** is encouraged to help
109
+ improve this project.
110
+
111
+ [free-sw]: http://www.fsf.org/licensing/essays/free-sw.html
105
112
 
106
113
  Here are some ways *you* can contribute:
107
114
 
108
115
  * by using alpha, beta, and prerelease versions
109
116
  * by reporting bugs
110
117
  * by suggesting new features
111
- * by [translating to a new language](https://github.com/sferik/rails_admin/wiki/Translations)
112
118
  * by writing or editing documentation
113
119
  * by writing specifications
114
- * by writing code (**no patch is too small**: fix typos, add comments, clean up inconsistent whitespace)
120
+ * by writing code (**no patch is too small**: fix typos, add comments, clean up
121
+ inconsistent whitespace)
115
122
  * by refactoring code
116
- * by resolving [issues](https://github.com/sferik/rails_admin/issues)
123
+ * by fixing [issues][]
117
124
  * by reviewing patches
118
- * [financially](http://pledgie.com/campaigns/15917)
119
-
120
- ## <a name="issues"></a>Submitting an Issue
121
- We use the [GitHub issue tracker](https://github.com/sferik/rails_admin/issues) to track bugs and
122
- features. Before submitting a bug report or feature request, please check to make sure it hasn't already
123
- been submitted. You can indicate support for an existing issue by voting it up. When submitting a
124
- bug report, please include a [Gist](https://gist.github.com/) that includes a stack trace and any
125
- details that may be necessary to reproduce the bug, including your gem version, Ruby version, and
126
- operating system. Ideally, a bug report should include a pull request with failing specs.
127
-
128
- ## <a name="pulls"></a>Submitting a Pull Request
129
- 1. Fork the project.
130
- 2. Create a topic branch.
131
- 3. Implement your feature or bug fix. *NOTE* - there's a small test app located in the
132
- spec/dummy_app directory that you can use to experiment with rails_admin.
133
- 4. Add documentation for your feature or bug fix.
134
- 5. Add specs for your feature or bug fix.
135
- 6. Commit and push your changes.
136
- 7. Submit a pull request. Please do not include changes to the gemspec, version, or history file.
137
- (If you want to create your own version for some reason, please do so in a separate commit.)
138
-
139
- ## <a name="versions"></a>Supported Ruby Versions
125
+ * [financially][pledgie]
126
+
127
+ [issues]: https://github.com/sferik/rails_admin/issues
128
+
129
+ ## Submitting an Issue
130
+ We use the [GitHub issue tracker][issues] to track bugs and features. Before
131
+ submitting a bug report or feature request, check to make sure it hasn't
132
+ already been submitted. When submitting a bug report, please include a [Gist][]
133
+ that includes a stack trace and any details that may be necessary to reproduce
134
+ the bug, including your gem version, Ruby version, and operating system.
135
+ Ideally, a bug report should include a pull request with failing specs.
136
+
137
+ [gist]: https://gist.github.com/
138
+
139
+ ## Submitting a Pull Request
140
+ 1. [Fork the repository.][fork]
141
+ 2. [Create a topic branch.][branch]
142
+ 3. Add specs for your unimplemented feature or bug fix.
143
+ 4. Run `bundle exec rake spec`. If your specs pass, return to step 3.
144
+ 5. Implement your feature or bug fix.
145
+ 6. Run `bundle exec rake spec`. If your specs fail, return to step 5.
146
+ 7. Run `open coverage/index.html`. If your changes are not completely covered
147
+ by your tests, return to step 3.
148
+ 8. Add, commit, and push your changes.
149
+ 9. [Submit a pull request.][pr]
150
+
151
+ [fork]: http://help.github.com/fork-a-repo/
152
+ [branch]: http://learn.github.com/p/branching.html
153
+ [pr]: http://help.github.com/send-pull-requests/
154
+
155
+ ## Supported Ruby Versions
140
156
  This library aims to support and is [tested against][travis] the following Ruby implementations:
141
157
 
142
158
  * Ruby 1.8.7
@@ -147,10 +163,3 @@ This library aims to support and is [tested against][travis] the following Ruby
147
163
 
148
164
  [rubinius]: http://rubini.us/
149
165
  [jruby]: http://jruby.org/
150
-
151
- ## <a name="screenshots"></a>Screenshots
152
- ![Dashboard view](https://github.com/sferik/rails_admin/raw/master/screenshots/dashboard.png "dashboard view")
153
- ![Delete view](https://github.com/sferik/rails_admin/raw/master/screenshots/delete.png "delete view")
154
- ![List view](https://github.com/sferik/rails_admin/raw/master/screenshots/list.png "list view")
155
- ![Nested view](https://github.com/sferik/rails_admin/raw/master/screenshots/nested.png "nested view")
156
- ![Polymophic edit view](https://github.com/sferik/rails_admin/raw/master/screenshots/polymorphic.png "polymorphic view")
data/Rakefile CHANGED
File without changes
@@ -4,7 +4,7 @@ $(document).live 'rails_admin.dom_ready', ->
4
4
 
5
5
  # colorpicker
6
6
 
7
- $('[data-color]').each ->
7
+ $('form [data-color]').each ->
8
8
  that = this
9
9
  $(this).ColorPicker
10
10
  color: $(that).val()
@@ -20,24 +20,24 @@ $(document).live 'rails_admin.dom_ready', ->
20
20
 
21
21
  # datetime
22
22
 
23
- $('[data-datetimepicker]').each ->
23
+ $('form [data-datetimepicker]').each ->
24
24
  $(this).datetimepicker $(this).data('options')
25
25
 
26
26
  # enumeration
27
27
 
28
- $('[data-enumeration]').each ->
28
+ $('form [data-enumeration]').each ->
29
29
  $(this).filteringSelect $(this).data('options')
30
30
 
31
31
  # fileupload
32
32
 
33
- $('[data-fileupload]').each ->
33
+ $('form [data-fileupload]').each ->
34
34
  input = this
35
35
  $(this).find(".delete input[type='checkbox']").live 'click', ->
36
36
  $(input).children('.toggle').toggle('slow')
37
37
 
38
38
  # filtering-multiselect
39
39
 
40
- $('[data-filteringmultiselect]').each ->
40
+ $('form [data-filteringmultiselect]').each ->
41
41
  $(this).filteringMultiselect $(this).data('options')
42
42
  if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
43
43
  $(this).parents('.control-group').find('.btn').remove()
@@ -46,7 +46,7 @@ $(document).live 'rails_admin.dom_ready', ->
46
46
 
47
47
  # filtering-select
48
48
 
49
- $('[data-filteringselect]').each ->
49
+ $('form [data-filteringselect]').each ->
50
50
  $(this).filteringSelect $(this).data('options')
51
51
  if $(this).parents("#modal").length # hide link if we already are inside a dialog (endless issues on nested dialogs with JS)
52
52
  $(this).parents('.control-group').find('.btn').remove()
@@ -55,7 +55,7 @@ $(document).live 'rails_admin.dom_ready', ->
55
55
 
56
56
  # nested-many
57
57
 
58
- $('[data-nestedmany]').each ->
58
+ $('form [data-nestedmany]').each ->
59
59
  field = $(this).parents('.control-group').first()
60
60
  nav = field.find('> .controls > .nav')
61
61
  content = field.find('> .tab-content')
@@ -81,7 +81,7 @@ $(document).live 'rails_admin.dom_ready', ->
81
81
 
82
82
  # nested-one
83
83
 
84
- $('[data-nestedone]').each ->
84
+ $('form [data-nestedone]').each ->
85
85
  field = $(this).parents('.control-group').first()
86
86
  nav = field.find("> .controls > .nav")
87
87
  content = field.find("> .tab-content")
@@ -100,7 +100,7 @@ $(document).live 'rails_admin.dom_ready', ->
100
100
 
101
101
  # polymorphic-association
102
102
 
103
- $('[data-polymorphic]').each ->
103
+ $('form [data-polymorphic]').each ->
104
104
  type_select = $(this)
105
105
  field = type_select.parents('.control-group').first()
106
106
  object_select = field.find('select').last()
@@ -124,11 +124,12 @@ $(document).live 'rails_admin.dom_ready', ->
124
124
 
125
125
  # ckeditor
126
126
 
127
- $('[data-richtext=ckeditor]').each ->
127
+ $('form [data-richtext=ckeditor]').not('.ckeditored').each ->
128
128
  window.CKEDITOR_BASEPATH = '/assets/ckeditor/'
129
129
  options = $(this).data('options')
130
130
  if not window.CKEDITOR
131
131
  $(window.document).append('<script src="' + options['jspath'] + '"><\/script>')
132
132
  if instance = window.CKEDITOR.instances[this.id]
133
- window.CKEDITOR.remove(instance)
133
+ instance.destroy(true)
134
134
  window.CKEDITOR.replace(this, options['options'])
135
+ $(this).addClass('ckeditored')
@@ -60,6 +60,3 @@ $(document).live 'rails_admin.dom_ready', ->
60
60
 
61
61
  $('.form-horizontal legend').has('i.icon-chevron-right').each ->
62
62
  $(this).siblings('.control-group').hide()
63
-
64
- $('[rel=tooltip]').tooltip(delay: { show: 200, hide: 500 });
65
-
@@ -96,8 +96,8 @@ module RailsAdmin
96
96
  actions.map do |action|
97
97
  wording = wording_for(:menu, action)
98
98
  %{
99
- <li data-original-title="#{wording}" rel="#{'tooltip' if only_icon}" class="icon #{action.key}_#{parent}_link #{'active' if current_action?(action)}">
100
- <a class="pjax" href="#{url_for({ :action => action.action_name, :controller => 'rails_admin/main', :model_name => abstract_model.try(:to_param), :id => (object.try(:persisted?) && object.try(:id) || nil) })}">
99
+ <li title="#{wording if only_icon}" rel="#{'tooltip' if only_icon}" class="icon #{action.key}_#{parent}_link #{'active' if current_action?(action)}">
100
+ <a class="#{action.key == :show_in_app ? '' : 'pjax'}" href="#{url_for({ :action => action.action_name, :controller => 'rails_admin/main', :model_name => abstract_model.try(:to_param), :id => (object.try(:persisted?) && object.try(:id) || nil) })}">
101
101
  <i class="#{action.link_icon}"></i>
102
102
  <span#{only_icon ? " style='display:none'" : ""}>#{wording}</span>
103
103
  </a>
@@ -41,12 +41,16 @@ module RailsAdmin
41
41
  end
42
42
 
43
43
  def field_wrapper_for field, nested_in
44
- # do not show nested field if the target is the origin
45
- unless field.inverse_of.presence && field.inverse_of == nested_in
46
- @template.content_tag(:div, :class => "control-group #{field.type_css_class} #{field.css_class} #{'error' if field.errors.present?}", :id => "#{dom_id(field)}_field") do
47
- label(field.method_name, field.label, :class => 'control-label') +
48
- (field.nested_form ? field_for(field) : input_for(field))
44
+ if field.label
45
+ # do not show nested field if the target is the origin
46
+ unless field.inverse_of.presence && field.inverse_of == nested_in
47
+ @template.content_tag(:div, :class => "control-group #{field.type_css_class} #{field.css_class} #{'error' if field.errors.present?}", :id => "#{dom_id(field)}_field") do
48
+ label(field.method_name, field.label, :class => 'control-label') +
49
+ (field.nested_form ? field_for(field) : input_for(field))
50
+ end
49
51
  end
52
+ else
53
+ (field.nested_form ? field_for(field) : input_for(field))
50
54
  end
51
55
  end
52
56
 
@@ -35,7 +35,9 @@ module RailsAdmin
35
35
  scope = scope.where(model.primary_key => options[:bulk_ids]) if options[:bulk_ids]
36
36
  scope = scope.where(query_conditions(options[:query])) if options[:query]
37
37
  scope = scope.where(filter_conditions(options[:filters])) if options[:filters]
38
- scope = scope.page(options[:page]).per(options[:per]) if options[:page] && options[:per]
38
+ if options[:page] && options[:per]
39
+ scope = scope.send(Kaminari.config.page_method_name, options[:page]).per(options[:per])
40
+ end
39
41
  scope = scope.reorder("#{options[:sort]} #{options[:sort_reverse] ? 'asc' : 'desc'}") if options[:sort]
40
42
  scope
41
43
  end
@@ -35,11 +35,13 @@ module RailsAdmin
35
35
  scope = scope.any_in(:_id => options[:bulk_ids]) if options[:bulk_ids]
36
36
  scope = scope.where(query_conditions(options[:query])) if options[:query]
37
37
  scope = scope.where(filter_conditions(options[:filters])) if options[:filters]
38
- scope = scope.page(options[:page]).per(options[:per]) if options[:page] && options[:per]
38
+ if options[:page] && options[:per]
39
+ scope = scope.send(Kaminari.config.page_method_name, options[:page]).per(options[:per])
40
+ end
39
41
  scope = sort_by(options, scope) if options[:sort]
40
42
  scope
41
43
  end
42
-
44
+
43
45
  def count(options = {},scope=nil)
44
46
  all(options.merge({:limit => false, :page => false}), scope).count
45
47
  end
@@ -317,7 +319,7 @@ module RailsAdmin
317
319
  association.foreign_key.to_sym rescue nil
318
320
  end
319
321
  end
320
-
322
+
321
323
  def association_type_lookup(macro)
322
324
  case macro.to_sym
323
325
  when :belongs_to, :referenced_in, :embedded_in
@@ -18,7 +18,6 @@ module RailsAdmin
18
18
  end
19
19
  end
20
20
 
21
-
22
21
  register_instance_option :link_icon do
23
22
  'icon-eye-open'
24
23
  end
@@ -10,10 +10,16 @@ module RailsAdmin
10
10
  register_instance_option :view_helper do
11
11
  :hidden_field
12
12
  end
13
-
14
- register_instance_option(:partial) do
15
- :form_field
13
+
14
+ register_instance_option :label do
15
+ false
16
+ end
17
+
18
+ register_instance_option :help do
19
+ false
16
20
  end
21
+
22
+
17
23
  end
18
24
  end
19
25
  end
@@ -1,9 +1,10 @@
1
1
  class RailsAdmin::History < ActiveRecord::Base
2
-
3
2
  self.table_name = :rails_admin_histories
4
3
 
5
4
  IGNORED_ATTRS = Set[:id, :created_at, :created_on, :deleted_at, :updated_at, :updated_on, :deleted_on]
6
5
 
6
+ attr_accessible :message, :item, :table, :username
7
+
7
8
  def self.latest
8
9
  self.limit(100)
9
10
  end
@@ -53,7 +54,7 @@ class RailsAdmin::History < ActiveRecord::Base
53
54
  else
54
55
  history = history.order('created_at DESC')
55
56
  end
56
- all ? history : history.page(page.presence || "1").per(per_page)
57
+ all ? history : history.send(Kaminari.config.page_method_name, page.presence || "1").per(per_page)
57
58
  end
58
59
 
59
60
  def self.history_for_object(model, object, query, sort, sort_reverse, all, page, per_page = (RailsAdmin::Config.default_items_per_page || 20))
@@ -64,6 +65,6 @@ class RailsAdmin::History < ActiveRecord::Base
64
65
  else
65
66
  history = history.order('created_at DESC')
66
67
  end
67
- all ? history : history.page(page.presence || "1").per(per_page)
68
+ all ? history : history.send(Kaminari.config.page_method_name, page.presence || "1").per(per_page)
68
69
  end
69
70
  end
@@ -69,7 +69,7 @@ module RailsAdmin
69
69
  versions = Version.where :item_type => model.model.name
70
70
  versions = versions.where("event LIKE ?", "%#{query}%") if query.present?
71
71
  versions = versions.order(sort_reverse == "true" ? "#{sort} DESC" : sort)
72
- versions = all ? versions : versions.page(page.presence || "1").per(per_page)
72
+ versions = all ? versions : versions.send(Kaminari.config.page_method_name, page.presence || "1").per(per_page)
73
73
  versions.map{|version| VersionProxy.new(version, @user_class)}
74
74
  end
75
75
 
@@ -83,7 +83,7 @@ module RailsAdmin
83
83
  versions = Version.where :item_type => model.model.name, :item_id => object.id
84
84
  versions = versions.where("event LIKE ?", "%#{query}%") if query.present?
85
85
  versions = versions.order(sort_reverse == "true" ? "#{sort} DESC" : sort)
86
- versions = all ? versions : versions.page(page.presence || "1").per(per_page)
86
+ versions = all ? versions : versions.send(Kaminari.config.page_method_name, page.presence || "1").per(per_page)
87
87
  versions.map{|version| VersionProxy.new(version, @user_class)}
88
88
  end
89
89
  end
@@ -1,3 +1,3 @@
1
1
  module RailsAdmin
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  class Ball < ActiveRecord::Base
2
+ attr_accessible :color
2
3
 
3
4
  validates_presence_of :color
4
5
 
@@ -1,3 +1,5 @@
1
1
  class Category < ActiveRecord::Base
2
+ attr_accessible :parent_category_id
3
+
2
4
  belongs_to :parent_category, :class_name => "Category"
3
5
  end
@@ -2,6 +2,8 @@ module Cms
2
2
  class BasicPage < ActiveRecord::Base
3
3
  self.table_name = :cms_basic_pages
4
4
 
5
+ attr_accessible :title, :content
6
+
5
7
  validates :title, :content, :presence => true
6
8
  end
7
9
  end
@@ -1,3 +1,5 @@
1
1
  class Comment < ActiveRecord::Base
2
+ attr_accessible :commentable_id, :commentable_type, :content
3
+
2
4
  belongs_to :commentable, :polymorphic => true
3
5
  end