Re: [Radiant] reorder extension problem

2009-07-30 Thread Jonathan Batchelor
I have fixed it by checking my schema_migrations table and deleting  
the Reorder-1 entry. I'm not sure why this got added without the  
migration happening - it may have been due to me running an import  
using import_export before installing the reorder extension.


Jonathan.

On 30 Jul 2009, at 09:33, Jonathan Batchelor wrote:


(changed subject to make more relevant)

Ok, thanks Mamed.

I was wondering though if this is a bug in the Rakefile or somewhere  
else? I'd be willing to try and fix it and submit the patch/update  
as necessary (perhaps a good way to learn more about migrations and  
git etc!).


Any clues?

Jonathan.


On 29 Jul 2009, at 18:42, Mamed Mamedov wrote:


Hi!

It was the same problem with *reorder* extension, after  
installation success
the migration task does nothing, therefore the /admin/pages page  
gives HTTP

500 error.
That is what I have done to make reorder extension complete it's
installation process:

selene# cat vendor/extensions/reorder/db/migrate/ 
01_add_position_to_pages.rb

class AddPositionToPages < ActiveRecord::Migration
def self.up
  add_column :pages, :position, :integer
  Page.reset_column_information
  say_with_time("Putting all pages in a default order...") do
ActiveRecord::Base.record_timestamps = false
Page.find_all_by_parent_id(nil).each do |p|
  put_children_into_list(p)
end
ActiveRecord::Base.record_timestamps = true
  end
end

def self.down
  remove_column :pages, :position
end

def self.put_children_into_list(page)
  page.children.find(:all, :order => "title asc").each_with_index  
do |pg,

idx|
pg.update_attribute('position', idx + 1)
put_children_into_list(pg)
  end
end
end

Then, run these:
selene# ./script/console
Loading development environment (Rails 2.1.2)




And copy the contents of file shown before to console and press  
Enter.
Finally, type this: AddPositionToPages.up(); and then press  
Enter :) Voila!


Hope this will help you!

Regards,
Mamed Mamedov


Samuel Goldwyn
- "I'm willing to admit that I may not always be right, but I am  
never

wrong."

2009/7/29 Jonathan Batchelor 


Thanks - seems to be working fine now!

I am however having issues with the reorder plugin.
When I install it, it fails to insert the "position" field into  
the pages
table. Possibly because I have no pages in my site yet (I want to  
use
import_export to grab them from a development install I have  
elsewhere) -
has anyone else seen this issue? I think the migration assumes  
that there
will be a page with no parent - but being fairly new to rails, I'm  
not sure
if that means the migration gets rolled back in the install or  
not... Then
again, I don't see the "say_with_time("Putting all pages in a  
default
order...") bit printed out either - perhaps it goes to a log  
somewhere

instead.

Thanks for all your help!

Jonathan.



On 28 Jul 2009, at 19:35, john muhl wrote:

i've just fixed this, update ray and you shouldn't run into that  
anymore.


On Tue, Jul 28, 2009 at 5:25 AM, Jonathan  
Batchelor

wrote:

I've been playing about with Radiant for a few days now and am  
really

liking it's simplicity and flexibility.

After installing on my MacBook and beginning some developmet I  
want to
install on my Dreamhost account. I have been migrated to a newer  
server

by
Dreamhost and have Radiant 0.8.0 working now.

I started to install install extensions and took the advice on  
the wiki
page to use ray as it will automatically reload Passenger for  
me. However
although the script/extensions install command works fine, as  
did setting
the config for ray using rake ray:setup:restart  
server=passenger, when I

come to install an extension it does not work. I have included the
--trace
output below - can anyone help?

Thanks,
Jonathan.

$ rake production ray:extension:install name=dashboard --trace
(in /home//_radiant)
** Invoke production (first_time)
** Execute production
** Invoke environment (first_time)
** Execute environment
** Invoke ray:extension:install (first_time)
** Execute ray:extension:install
rake aborted!
undefined method `strip' for nil:NilClass

/home//_radiant/vendor/extensions/ray/lib/tasks/ 
ray_extension_tasks.rake:807:in

`get_download_preference'

/home//_radiant/vendor/extensions/ray/lib/tasks/ 
ray_extension_tasks.rake:151:in

`install_extension'

/home//_radiant/vendor/extensions/ray/lib/tasks/ 
ray_extension_tasks.rake:20

/home//.gems/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/home//.gems/gems/rake-

Re: [Radiant] reorder extension problem

2009-07-30 Thread Jonathan Batchelor

(changed subject to make more relevant)

Ok, thanks Mamed.

I was wondering though if this is a bug in the Rakefile or somewhere  
else? I'd be willing to try and fix it and submit the patch/update as  
necessary (perhaps a good way to learn more about migrations and git  
etc!).


Any clues?

Jonathan.


On 29 Jul 2009, at 18:42, Mamed Mamedov wrote:


Hi!

It was the same problem with *reorder* extension, after installation  
success
the migration task does nothing, therefore the /admin/pages page  
gives HTTP

500 error.
That is what I have done to make reorder extension complete it's
installation process:

selene# cat vendor/extensions/reorder/db/migrate/ 
01_add_position_to_pages.rb

class AddPositionToPages < ActiveRecord::Migration
 def self.up
   add_column :pages, :position, :integer
   Page.reset_column_information
   say_with_time("Putting all pages in a default order...") do
 ActiveRecord::Base.record_timestamps = false
 Page.find_all_by_parent_id(nil).each do |p|
   put_children_into_list(p)
 end
 ActiveRecord::Base.record_timestamps = true
   end
 end

 def self.down
   remove_column :pages, :position
 end

 def self.put_children_into_list(page)
   page.children.find(:all, :order => "title asc").each_with_index  
do |pg,

idx|
 pg.update_attribute('position', idx + 1)
 put_children_into_list(pg)
   end
 end
end

Then, run these:
selene# ./script/console
Loading development environment (Rails 2.1.2)




And copy the contents of file shown before to console and press Enter.
Finally, type this: AddPositionToPages.up(); and then press Enter :)  
Voila!


Hope this will help you!

Regards,
Mamed Mamedov


Samuel Goldwyn

- "I'm willing to admit that I may not always be right, but I am never
wrong."

2009/7/29 Jonathan Batchelor 


Thanks - seems to be working fine now!

I am however having issues with the reorder plugin.
When I install it, it fails to insert the "position" field into the  
pages

table. Possibly because I have no pages in my site yet (I want to use
import_export to grab them from a development install I have  
elsewhere) -
has anyone else seen this issue? I think the migration assumes that  
there
will be a page with no parent - but being fairly new to rails, I'm  
not sure
if that means the migration gets rolled back in the install or  
not... Then

again, I don't see the "say_with_time("Putting all pages in a default
order...") bit printed out either - perhaps it goes to a log  
somewhere

instead.

Thanks for all your help!

Jonathan.



On 28 Jul 2009, at 19:35, john muhl wrote:

i've just fixed this, update ray and you shouldn't run into that  
anymore.


On Tue, Jul 28, 2009 at 5:25 AM, Jonathan Batchelor
wrote:

I've been playing about with Radiant for a few days now and am  
really

liking it's simplicity and flexibility.

After installing on my MacBook and beginning some developmet I  
want to
install on my Dreamhost account. I have been migrated to a newer  
server

by
Dreamhost and have Radiant 0.8.0 working now.

I started to install install extensions and took the advice on  
the wiki
page to use ray as it will automatically reload Passenger for me.  
However
although the script/extensions install command works fine, as did  
setting
the config for ray using rake ray:setup:restart server=passenger,  
when I

come to install an extension it does not work. I have included the
--trace
output below - can anyone help?

Thanks,
Jonathan.

$ rake production ray:extension:install name=dashboard --trace
(in /home//_radiant)
** Invoke production (first_time)
** Execute production
** Invoke environment (first_time)
** Execute environment
** Invoke ray:extension:install (first_time)
** Execute ray:extension:install
rake aborted!
undefined method `strip' for nil:NilClass

/home//_radiant/vendor/extensions/ray/lib/tasks/ 
ray_extension_tasks.rake:807:in

`get_download_preference'

/home//_radiant/vendor/extensions/ray/lib/tasks/ 
ray_extension_tasks.rake:151:in

`install_extension'

/home//_radiant/vendor/extensions/ray/lib/tasks/ 
ray_extension_tasks.rake:20

/home//.gems/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home//.gems/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home//.gems/gems/rake-0.8.