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

Exception from whitelisting? method in params.rb #46

Closed
kirs opened this issue Oct 20, 2014 · 5 comments
Closed

Exception from whitelisting? method in params.rb #46

kirs opened this issue Oct 20, 2014 · 5 comments
Assignees
Labels

Comments

@kirs
Copy link
Contributor

kirs commented Oct 20, 2014

Looks like the attributes method is not defined at all in params.rb:

Here is the stacktrace:

NameError: undefined local variable or method `attributes' for Janus::Controllers::Home::Index::Params:Class
  /Users/kir/Projects/lotus-controller/lib/lotus/action/params.rb:140:in `whitelisting?'
  /Users/kir/Projects/lotus-controller/lib/lotus/action/params.rb:163:in `_whitelist'
  /Users/kir/Projects/lotus-controller/lib/lotus/action/params.rb:145:in `_compute_params'
  /Users/kir/Projects/lotus-controller/lib/lotus/action/params.rb:105:in `initialize'
  /Users/kir/Projects/lotus-controller/lib/lotus/action/callable.rb:72:in `new'
  /Users/kir/Projects/lotus-controller/lib/lotus/action/callable.rb:72:in `block in call'
  /Users/kir/Projects/lotus-controller/lib/lotus/action/throwable.rb:100:in `block in _rescue'
  /Users/kir/Projects/lotus-controller/lib/lotus/action/throwable.rb:98:in `catch'
  /Users/kir/Projects/lotus-controller/lib/lotus/action/throwable.rb:98:in `_rescue'
  /Users/kir/Projects/lotus-controller/lib/lotus/action/callable.rb:69:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/lotus-router-0.1.1/lib/lotus/routing/endpoint.rb:66:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/http_router-0.11.1/lib/http_router.rb:193:in `process_destination_path'
  (eval):18:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/http_router-0.11.1/lib/http_router.rb:288:in `raw_call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/http_router-0.11.1/lib/http_router.rb:142:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/lotus-router-0.1.1/lib/lotus/router.rb:797:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/static.rb:119:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/lotus-8d51feebbc85/lib/lotus/middleware.rb:57:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/lotus-8d51feebbc85/lib/lotus/application.rb:152:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/lint.rb:49:in `_call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/lint.rb:37:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/showexceptions.rb:24:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
  /Users/kir/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/chunked.rb:43:in `call'

And the action:

module Home
  class Index
    include Janus::Action
    include Janus::Action::Session

    def call(params)
      puts params
    end
  end
end
@jodosha
Copy link
Member

jodosha commented Oct 20, 2014

@kirs Thanks for reporting this. Which version are you using? Because those functionalities are in master, but not released as gem yet.

@kirs
Copy link
Contributor Author

kirs commented Oct 20, 2014

I'm using master of lotus/controller, master of lotusrb, and master of lotus-view

@kirs
Copy link
Contributor Author

kirs commented Oct 20, 2014

It solved as soon as I added lotus-validations from master.

@jodosha jodosha self-assigned this Oct 22, 2014
@jodosha
Copy link
Member

jodosha commented Oct 23, 2014

@kirs as today I've released lotus-validations 0.1.0, can please confirm if it now your application works without your fix?

@jodosha
Copy link
Member

jodosha commented Nov 23, 2014

Whitelisting is now a lotus-validation responsibility as of today's release v0.2.0.
This should be fixed now. Closing.

@jodosha jodosha closed this as completed Nov 23, 2014
@jodosha jodosha removed the waiting label Nov 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants