netzke / netzke-core

Framework for Sencha Ext JS + Ruby on Rails client-server components
http://netzke.org
Other
263 stars 77 forks source link

Rails 3.2 support #27

Closed iuri-gg closed 12 years ago

iuri-gg commented 12 years ago

Netzke is not working in rails 3.2. App cannot start because of read/write_inheritable_attribute call. instead of setter and getter methods, rails 3.2 uses class_attribute[:attr] for read/write (I think).

Also there is a deprecation warning for ActiveConcern.

Mayar commented 12 years ago

Confirm.

0rca commented 12 years ago

Please, check out rails-upgrade branch and see if it works.

mxgrn commented 12 years ago

I had a look at the commit, and would like to suggest that you define read_inheritable_attribute and such only when those are not defined by ActiveSupport - this should provide us with Rails 3.1 backward compatibility as bonus. Also, defining them plainly on Class feels hackish, there may be a cleaner way.

RushOnline commented 12 years ago

rails-upgrade branch works ok with:

ruby 1.9.3p125 Rails 3.2.2 ExtJS ext-4.0.7-gpl

gernberg commented 12 years ago

Sorry for the long comment - just attached the whole error message that I get on RoR 3.2.2

DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from extend at /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke/composition.rb:103)
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in Netzke::Configuration instead. (called from include at /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke/base.rb:36)
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in Netzke::Javascript instead. (called from include at /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke/base.rb:37)
DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in Netzke::Composition instead. (called from include at /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke/base.rb:40)
/home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke/services.rb:60:in `register_endpoint': undefined method `read_inheritable_attribute' for Netzke::Base:Class (NoMethodError)
    from /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke/services.rb:37:in `endpoint'
    from /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke/composition.rb:33:in `block in <module:Composition>'
    from /home/gustav/.gem/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/concern.rb:119:in `class_eval'
    from /home/gustav/.gem/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/concern.rb:119:in `append_features'
    from /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke/base.rb:40:in `include'
    from /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke/base.rb:40:in `<class:Base>'
    from /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke/base.rb:33:in `<module:Netzke>'
    from /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke/base.rb:17:in `<top (required)>'
    from /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke-core.rb:4:in `require'
    from /home/gustav/.bundler/ruby/1.9.1/netzke-core-f82244fbd9b6/lib/netzke-core.rb:4:in `<top (required)>'
    from /home/gustav/.gem/ruby/1.9.1/gems/bundler-1.1.2/lib/bundler/runtime.rb:68:in `require'
    from /home/gustav/.gem/ruby/1.9.1/gems/bundler-1.1.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /home/gustav/.gem/ruby/1.9.1/gems/bundler-1.1.2/lib/bundler/runtime.rb:66:in `each'
    from /home/gustav/.gem/ruby/1.9.1/gems/bundler-1.1.2/lib/bundler/runtime.rb:66:in `block in require'
    from /home/gustav/.gem/ruby/1.9.1/gems/bundler-1.1.2/lib/bundler/runtime.rb:55:in `each'
    from /home/gustav/.gem/ruby/1.9.1/gems/bundler-1.1.2/lib/bundler/runtime.rb:55:in `require'
    from /home/gustav/.gem/ruby/1.9.1/gems/bundler-1.1.2/lib/bundler.rb:119:in `require'
    from /home/gustav/rails/cccp/config/application.rb:7:in `<top (required)>'
    from /home/gustav/.gem/ruby/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:53:in `require'
    from /home/gustav/.gem/ruby/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /home/gustav/.gem/ruby/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:50:in `tap'
    from /home/gustav/.gem/ruby/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
RushOnline commented 12 years ago

@gernberg you must specify "rails-upgrade" branch in your Gemfile:

gem 'netzke-core', :git => "git://github.com/skozlov/netzke-core.git", :branch => "rails-upgrade"

Don't forget to do

bundle install

If you trying to follow tutorial, you must change class_name in file index.html.erb from "Basepack::GridPanel" to "Netzke::Basepack::GridPanel"

gernberg commented 12 years ago

@RushOnline Thank you - that fixed the issue.

Why isn't that in master? (since rails 3.2 is stable)

mxgrn commented 12 years ago

Because the solution in this branch is not yet backward compatible with Rails 3.1. I'll fix this soon.

Sergei Kozlov

On Thursday 22 March 2012 at 20:22, Gustav Ernberg wrote:

@RushOnline Thank you - that fixed the issue.

Why isn't that in master? (since rails 3.2 is stable)


Reply to this email directly or view it on GitHub: https://github.com/skozlov/netzke-core/issues/27#issuecomment-4638036

phlegx commented 12 years ago

Rails 3.2.1, Ruby 1.9.3

Gemfile

gem 'netzke-core', :git => 'git://github.com/nomadcoder/netzke-core.git', :branch => "rails-upgrade"
gem 'netzke-basepack', :git => 'git://github.com/nomadcoder/netzke-basepack.git', :branch => "multi-orm"
gem 'netzke-communitypack', :git => 'git://github.com/nomadcoder/netzke-communitypack.git'

I use branch "rails-upgrade" in the netzke-core. I use "multi-orm" branch in the netzke-basepack because i have mongoid with mongodb running. I get an error:

NoMethodError (undefined method `netzke_attributes' for Account:Class):

AND

DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from extend at /.rvm/gems/ruby-1.9.3-p194@test/bundler/gems/netzke-basepack-02d4d2137000/lib/ne
tzke/basepack/grid_panel/columns.rb:6)
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from extend at /.rvm/gems/ruby-1.9.3-p194@test/bundler/gems/netzke-basepack-02d4d2137000/lib/ne
tzke/basepack/grid_panel.rb:151)

What can I do to solve the error problem?

mxgrn commented 12 years ago

Rails3.2-ready by now.