|
osdir.com mailing list archive F.A.Q. -since 2001! |
|
|
|
Subject: Re: not_naughty with 2.0 - msg#00014List: lang.ruby.sequel
by Date: Prev Next Date Index by Thread: Prev Next Thread Index
On Jun 2, 8:59 pm, dusty <dusty.do...-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote: > I'm having trouble getting my models to load up with sequel 2.0 and > not_naughty 0.5.1 downloaded from rubyforge. It appears there has > been some interface changes and not_naughty might need to be updated. > > Here is the error I get > > NoMethodError: undefined method `def_hook_method' for Tester:Class > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > sequel_not_naughty.rb:88:in `included' > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > sequel_not_naughty.rb:87:in `instance_eval' > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > sequel_not_naughty.rb:87:in `included' > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > sequel_not_naughty.rb:76:in `include' > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > sequel_not_naughty.rb:76:in `send!' > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > sequel_not_naughty.rb:76:in `apply' > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/sequel-2.0.0/lib/ > sequel_model/plugins.rb:25:in `is' > from ./tester.rb:14 > from (irb):1:in `require' > from (irb):1 > > Has def_hook_method recently been dropped? I don't think it is used any more. Hooks methods are defined via: instance_eval("def #{hook}(method = nil, &block); add_hook(:#{hook}, method, &block) end") not_naughty probably needs to be updated. Note that if the only reason you are using not_naughty is for conditional feature (:if option), that's going to be added to the default validations fairly soon. dtsato has a branch at github that implements it, I'll be merging it after I have some more time to review it and test it. Jeremy
Thread at a glance:
Previous Message by Date:not_naughty with 2.0I'm having trouble getting my models to load up with sequel 2.0 and not_naughty 0.5.1 downloaded from rubyforge. It appears there has been some interface changes and not_naughty might need to be updated. Here is the error I get NoMethodError: undefined method `def_hook_method' for Tester:Class from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:88:in `included' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:87:in `instance_eval' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:87:in `included' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:76:in `include' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:76:in `send!' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:76:in `apply' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/sequel-2.0.0/lib/ sequel_model/plugins.rb:25:in `is' from ./tester.rb:14 from (irb):1:in `require' from (irb):1 Has def_hook_method recently been dropped? Thanks Next Message by Date:Re: not_naughty with 2.0On Jun 3, 12:05 am, Jeremy Evans <jeremyeva...-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote: > On Jun 2, 8:59 pm, dusty > <dusty.do...-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote: > > > > > I'm having trouble getting my models to load up with sequel 2.0 and > > not_naughty 0.5.1 downloaded from rubyforge. It appears there has > > been some interface changes and not_naughty might need to be updated. > > > Here is the error I get > > > NoMethodError: undefined method `def_hook_method' for Tester:Class > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:88:in `included' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:87:in `instance_eval' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:87:in `included' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:76:in `include' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:76:in `send!' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:76:in `apply' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/sequel-2.0.0/lib/ > > sequel_model/plugins.rb:25:in `is' > > from ./tester.rb:14 > > from (irb):1:in `require' > > from (irb):1 > > > Has def_hook_method recently been dropped? > > I don't think it is used any more. Hooks methods are defined via: > > instance_eval("def #{hook}(method = nil, &block); add_hook(:#{hook}, > method, &block) end") > > not_naughty probably needs to be updated. > > Note that if the only reason you are using not_naughty is for > conditional feature (:if option), that's going to be added to the > default validations fairly soon. dtsato has a branch at github that > implements it, I'll be merging it after I have some more time to > review it and test it. > > Jeremy Thanks for the update. That does happen to be the only reason I was going to use it. I was going to try to roll one myself, but thought I'd give not_naughty a look at first. I am looking forward to the merge and I appreciate the heads up! -Dusty Previous Message by Thread:not_naughty with 2.0I'm having trouble getting my models to load up with sequel 2.0 and not_naughty 0.5.1 downloaded from rubyforge. It appears there has been some interface changes and not_naughty might need to be updated. Here is the error I get NoMethodError: undefined method `def_hook_method' for Tester:Class from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:88:in `included' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:87:in `instance_eval' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:87:in `included' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:76:in `include' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:76:in `send!' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ sequel_not_naughty.rb:76:in `apply' from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/sequel-2.0.0/lib/ sequel_model/plugins.rb:25:in `is' from ./tester.rb:14 from (irb):1:in `require' from (irb):1 Has def_hook_method recently been dropped? Thanks Next Message by Thread:Re: not_naughty with 2.0On Jun 3, 12:05 am, Jeremy Evans <jeremyeva...-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote: > On Jun 2, 8:59 pm, dusty > <dusty.do...-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote: > > > > > I'm having trouble getting my models to load up with sequel 2.0 and > > not_naughty 0.5.1 downloaded from rubyforge. It appears there has > > been some interface changes and not_naughty might need to be updated. > > > Here is the error I get > > > NoMethodError: undefined method `def_hook_method' for Tester:Class > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:88:in `included' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:87:in `instance_eval' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:87:in `included' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:76:in `include' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:76:in `send!' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/not_naughty-0.5.1/lib/ > > sequel_not_naughty.rb:76:in `apply' > > from /opt/ruby-1.8.7/lib/ruby/gems/1.8/gems/sequel-2.0.0/lib/ > > sequel_model/plugins.rb:25:in `is' > > from ./tester.rb:14 > > from (irb):1:in `require' > > from (irb):1 > > > Has def_hook_method recently been dropped? > > I don't think it is used any more. Hooks methods are defined via: > > instance_eval("def #{hook}(method = nil, &block); add_hook(:#{hook}, > method, &block) end") > > not_naughty probably needs to be updated. > > Note that if the only reason you are using not_naughty is for > conditional feature (:if option), that's going to be added to the > default validations fairly soon. dtsato has a branch at github that > implements it, I'll be merging it after I have some more time to > review it and test it. > > Jeremy Thanks for the update. That does happen to be the only reason I was going to use it. I was going to try to roll one myself, but thought I'd give not_naughty a look at first. I am looking forward to the merge and I appreciate the heads up! -Dusty
blog comments powered by Disqus
|
|