PiRSquared17 / activescaffold

Automatically exported from code.google.com/p/activescaffold
MIT License
0 stars 0 forks source link

ActiveScaffold Broken is paginator gem installed #729

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install latest ActiveScaffold
2. Install paginator gem
3. Try to do anything

What is the expected output? What do you see instead?
Expect it to work. Instead get error

What version (or revision) of the product are you using?
Tip of git master branch. Paginator gem 1.1.1

If this bug causes an exception, please paste at least the first 20 lines
below.

ActionView::TemplateError (undefined method `infinite?' for
#<Paginator:0x10f0c4828>) on line #19 of
vendor/plugins/active_scaffold/frontends/default/views/_list_pagination_links.ht
ml.erb:
16:           :method => :get },
17:         { :href => previous_url,
18:           :class => "previous"}) if current_page.prev? %>
19:   <%= pagination_ajax_links current_page, pagination_params,
active_scaffold_config.list.page_links_window %>
20:   <%= link_to_remote(as_(:next),
21:         { :url => pagination_params.merge(:page => current_page.number
+ 1),
22:           :after => "$('#{loading_indicator_id(:action =>
:pagination)}').style.visibility = 'visible';",

    lib/enumerable_sugar.rb:8:in `method_missing'

vendor/plugins/active_scaffold/frontends/default/views/_list_pagination_links.ht
ml.erb:19
    haml (2.2.16) lib/haml/helpers/action_view_mods.rb:13:in
`render_without_active_scaffold'
    app/views/active_scaffold_overrides/_list.rhtml:40:in
`_run_rhtml_app47views47active_scaffold_overrides47_list46rhtml_locals_list_obje
ct'
    haml (2.2.16) lib/haml/helpers/action_view_mods.rb:13:in
`render_without_active_scaffold'
    app/views/active_scaffold_overrides/list.rhtml:9:in
`_run_rhtml_app47views47active_scaffold_overrides47list46rhtml'
    haml (2.2.16) lib/haml/helpers/action_view_mods.rb:13:in
`render_without_active_scaffold'
    haml (2.2.16) lib/haml/helpers/action_view_mods.rb:13:in
`render_without_active_scaffold'
    haml (2.2.16) lib/sass/plugin/rails.rb:19:in `process'
    config/./lib/fancat_cookie_session_store.rb:10:in `call'

Original issue reported on code.google.com by andrew.s...@gmail.com on 20 Feb 2010 at 12:38

GoogleCodeExporter commented 9 years ago
This looks like a load path order problem.

If you have the gem installed, its directory is in the load path before the 
plug in
directory. Hence the unaltered system file get required rather than the patched 
version.

Probably better to put the monkey patch in a seperate file and include it
specifically so that it will add the missing method to what ever Paginator gets 
loaded.

I'll try to whip up a patch tonight.

Original comment by andrew.s...@gmail.com on 20 Feb 2010 at 12:42

GoogleCodeExporter commented 9 years ago
Here's a quick patch... can someone take a look and make sure I haven't screwed 
up
something completely :)

Original comment by andrew.s...@gmail.com on 20 Feb 2010 at 1:02

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed, I didn't know paginator gem, neither paginator.rb were a copy from that 
gem.

Original comment by sergio.c...@gmail.com on 22 Feb 2010 at 8:55