Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't export #495

Closed
catmando opened this issue Jul 16, 2014 · 6 comments
Closed

Can't export #495

catmando opened this issue Jul 16, 2014 · 6 comments

Comments

@catmando
Copy link

I get the below error when exporting. (comfortable_mexican_sofa (1.12.1))

I did some digging and it doesn't seem that any of my blocks have a page reference.

There was a recent change adding the offending lines of code, perhaps that is the problem?

NoMethodError: undefined method `page' for #<Comfy::Cms::Block:0x007fb1451fec50>                                                                                                 
/home/action/.gem/ruby/2.1.1/gems/activemodel-4.1.0/lib/active_model/attribute_methods.rb:435:in `method_missing'                                                                
/home/action/.gem/ruby/2.1.1/gems/activerecord-4.1.0/lib/active_record/attribute_methods.rb:206:in `method_missing'                                                              
/home/action/.gem/ruby/2.1.1/gems/comfortable_mexican_sofa-1.12.1/lib/comfortable_mexican_sofa/fixture/file.rb:54:in `block in export!'                                          
/home/action/.gem/ruby/2.1.1/gems/activerecord-4.1.0/lib/active_record/relation/delegation.rb:46:in `each'                                                                       
/home/action/.gem/ruby/2.1.1/gems/activerecord-4.1.0/lib/active_record/relation/delegation.rb:46:in `each'                                                                       
/home/action/.gem/ruby/2.1.1/gems/comfortable_mexican_sofa-1.12.1/lib/comfortable_mexican_sofa/fixture/file.rb:51:in `export!'                                                   
/home/action/.gem/ruby/2.1.1/gems/comfortable_mexican_sofa-1.12.1/lib/comfortable_mexican_sofa/fixture.rb:72:in `export!'                                                        
/home/action/.gem/ruby/2.1.1/gems/comfortable_mexican_sofa-1.12.1/lib/tasks/comfortable_mexican_sofa.rake:32:in `block (3 levels) in <top (required)>'            
@catmando
Copy link
Author

Just tried moving back to 1.12.0 and it seems better

@kirichkov
Copy link

It's a bug in the exporter. Add this code at the end of your CMS initializer at config/initializers/comfortable_mexican_sofa.rb and exporting should work.

@glance-
Copy link

glance- commented Nov 20, 2014

That monkey-patch just kills of any functionality with files linked to pages.The right fix is instead referring to block.blockable instead of bock.page

--- i/lib/comfortable_mexican_sofa/fixture/file.rb
+++ w/lib/comfortable_mexican_sofa/fixture/file.rb
@@ -49,12 +49,12 @@ module ComfortableMexicanSofa::Fixture::File
       prepare_folder!(self.path)

       self.site.files.each do |file|
         file_path = File.join(self.path, file.file_file_name)
-        page = block.present?? block.page : nil
+        page = block.present?? block.blockable : nil

         # writing attributes

@JoppeSchwartz
Copy link

Thanks @glance - I had the same problem, and your solution worked nicely. Are you going to submit a PR for this?

@glance-
Copy link

glance- commented Mar 24, 2015

Nope. You can do it.

@GBH
Copy link
Member

GBH commented Apr 19, 2015

This is fixed in master

@GBH GBH closed this as completed Apr 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants