Displaying 20 results from an estimated 2000 matches similar to: "aliasing, require_dependency and require"
2011 Apr 08
5
How to extend a helper using plugin?
Hello,
I''m facing this problem while trying to extend the parse_redmine_links
helper method in Redmine-1.1.0 (Rails-2.3.5) from my plugin.
My idea is to use alias_method_chain so the extended version could
call the original version and adjust the result to it''s liking.
Anything I''ve tried so far exposes this behavior: the first render of
a page uses the extended
2008 Nov 03
1
concerned_with, and maybe require_dependency issues only when running specs?
Hi all,
So in the interests of keeping a few areas of my code a bit under control,
I''ve been investigating the concept of "concerned_with" as described here:
http://paulbarry.com/articles/2008/08/30/concerned-with-skinny-controller-skinny-model
Basically allowing me to have:
/app/models/user.rb
class User < ActiveRecord::Base
concerned_with :something
end
2005 Sep 27
5
Am I misunderstanding "require_dependency"?
Hi
From what I understand about documentation about require_dependency,
this function will work like require but the file will be reloaded on
every request to the server when in development mode.
I have bootstrapped am minimal RoR project with 0.13.1 Rails. I have
created a minimal Controller and hooked up it''s "index" action at the
site root. I have also created a
2012 Apr 07
3
Is require_dependency supposed to be a public API?
If so, shouldn''t it be documented in the Rails API?
Or is there a better way to allow class reloading of my files under lib.
I mean, I know about config.autoload_paths, but I want to be explicit
about my requires. I just want to be able to reload then on each request
when I''m working on them.
require_dependency seems to do just that but I''m worried since it is not
2012 Jun 07
3
Couldn't reload a module when it's changed. Tried :require_dependency, :watchable_dirs, :unloadable
I''m completely messed with module reloading in development mode. I have
to restart app server each time I edit lib/z/nginx.rb which is included
in app/models/user_case.rb
app/models/user_case.rb
require_dependency ''z/nginx''
class UserCase < ActiveRecord::Base
include Z::Nginx
unloadable
I added to environment.rb
2007 Jan 22
6
[Ferret] Test failures for ferret tagged REL-0.10.14
Hi Dave,
I''ve been getting some segment faults while running my tests using
0.10.14 gem so I decided to package the gem locally to add -dH and
generate core dumps for you.
So I followed instructions here
http://ferret.davebalmain.com/trac/wiki/DownloadCurrent and first off
ran the tests.
I''m getting the following failures. (see this pastie
http://pastie.caboo.se/34790).
I
2006 Jul 02
0
Rails Core Weekly June 19 - July 2 2006
This is another edition of Rails Core Weekly, affectionately known as
RCW. A much nicer pre-web 3.0 version is available from the following
url :
http://www.pinupgeek.com/articles/category/rails-core-weekly-news
We have an Atom/RSS feed available there as well.
Rails Core Weekly summarizes the rails-core mailing list, a list
dedicated to Ruby on Rails internals and its development. RCW is
2006 Jan 30
2
problem redefining module method
I''m having a problem redefining a method in one of my modules. Lets
say I have this module in /lib:
module Hello
def say_hello
"hello"
end
end
And one of my ActiveRecord models mixes it in like:
class Item < ActiveRecord::Base
include Hello
end
This works fine, I can call @item.say_hello just fine. But when I try
to redefine the method:
class Item <
2007 Nov 28
8
include vs. require vs. require_dependency
i am struggling a bit with all of them .. could someone be so nice a
describe me the exact differences, pros & cons of all of them ... thx a
lot!
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2009 Jul 28
4
RJS-Template and link_to_remote
Hi, I am quite new to rails and can''t use any rjs-templates.
The problem is, that he can''t use/find the methods in that template
e.g. ''page'' or ''replace_html''. I get an error message on these
methods.
Here''s what I got so far in my example:
Controller:
----
class AjaxTestController < ApplicationController
layout
2009 Jan 20
0
alias_method_chain in Facebooker Causing Stack Level Too Deep
I installed the Facebooker plugin and upon placing it on a staging server, I
keep running into stack level too deep errors. It seems to stem from
Facebooker using alias_method_chain to override some of the
ActionController methods. I believe it''s getting loaded twice causing
confusion. I''ve tried various methods include wrapping a unless
respond_to?(:method) around the
2007 Apr 04
1
Password required for dejavu repo
Since this morning, the server at http://svn.devjavu.com/backgroundrb
is requiring authorized access.
Could you guys look into it?
Thanks,
Saimon
--
Saimon Moore
Freelance Web Developer
(Available for hire - For details visit http://saimonmoore.net)
Skype: saimonmoore
Yahoo IM: saimonmoore
Google IM: saimonmoore
2006 Dec 26
0
alias_method_chain vs. redefined method with super
I''m trying to fully understand the subtleties of using
alias_method_chain to refine method behavior versus redefining a method
and calling super. I have a simple data model (a music collection) that
I often use to evaluate web frameworks, and I''m trying to get it working
on Rails 1.2.0RC1.
Specifically, I have three classes which subclass a common Artist class:
- Band
2006 May 25
1
New BackgrounDRb release
Friends-
There is a new release of BackgrounDRb. This time it is a full
fledged rails plugin with generators and rake tasks thanks to Saimon
Moore. Thanks Saimon!
You can read all about it here on my blog:
http://brainspl.at/articles/2006/05/25/backgroundrb-new-release
The newest feature besides the much cleaner way to install and
control the drb server is caching. You can now use
2007 Apr 12
0
Does Ferret have problems with #alias_method_chain ?
Hi all,
I have this in my class:
class Party < AR::B
acts_as_ferret :store_class_name => true, :remote => true,
:fields => (self.content_columns.map(&:name) rescue []) +
%w(main_identifier)
class << self
# #count is also defined, omitted for clarity
def find_with_destroyed_scope(*args)
with_destroyed_scope do
2006 Aug 16
0
acts_as_paranoid and alias_method_chain
when i require acts_as_paranoid I''m getting: undefined method
`alias_method_chain'' for #<Class:ActiveRecord::Base> (NoMethodError)
It happens in acts_as_paranoid''s init.rb. here''s the whole file. the
alias_method_chain is near the bottom. please advise.
class << ActiveRecord::Base
def belongs_to_with_deleted(association_id, options = {})
2006 Mar 07
3
STI and unit testing
Hi all, I''m having a bit of a problem with unit testing. I''ve simplified my
models to try and get my head round it but I''m still struggling. I''m using
STI and trying to write tests for the extended models (code below). I''ve
written test cases for the extended models which themselves extend the test
case for the parent model, so BarTest extends
2010 Feb 11
2
LinkingTo and C++
Hello,
I've been trying to make LinkingTo work when the package linked to has
c++ code.
I've put dumb packages to illustrate this emails here ;
http://addictedtor.free.fr/misc/linkingto
Package A defines this C++ class:
class A {
public:
A() ;
~A() ;
SEXP hello() ;
} ;
Package B has this function :
SEXP say_hello(){
A a ;
return a.hello() ;
}
headers of package A are copied
2009 Oct 21
3
alias_method_chain and ActiveSupport::TestCase
I''m trying to add some functionality to the setup method of all my
tests.
I added a method called setup_with_ts in the test_helper and chained
it using alias_method_chain :setup, :ts and that works great for every
test that does not define setup in the test.
So for my unit tests i tried also defining the same method
setup_with_ts in a
class ActiveSupport::TestCase
def setup_with_ts
2012 Jun 09
3
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Transactions::DummyDdnlTransaction'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Pleas
Hello,
I stumble upon this error when loading a subclass of the Transaction
class. For full details, see the pastie:
http://pastie.org/4053678
Error message: ActiveRecord::SubclassNotFound: The single-table
inheritance mechanism failed to locate the subclass:
''Transactions::DummyDdnlTransaction''. This error is raised because the
column ''type'' is reserved for