Displaying 20 results from an estimated 160 matches for "require_dependencies".
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
2006 Jan 29
15
Reload the lib directory
Im writing a module in the lib directory.
If I change the module, the changes are not visible to the application
when i releod the web page (i am in the development evironment).
I must restart the web server (WEBrick) and so i see the changes... but
I lost more time.
How can I reload the module in the dirictory lib, without reload
WEBrick?
Thanks so much
--Reis
--
Posted via
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
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
2007 Mar 13
0
aliasing, require_dependency and require
I''d really appreciate it if someone [with a decent understanding of the
rails Dependencies mechanism] could help me explain the behaviour seen
in this pastie.
http://pastie.caboo.se/46630
The desired behaviour is simply aliasing a method in
ApplicationController from a plugin while retaining automatic reloading
in dev mode.
The pastie is basically divided into 4 parts:
- Setup of
2009 May 08
3
STI and subclassing twice
I''m trying using STI to implement a hiearchy similar to this:
script/generate scaffold name:string type:string
class Person < ActiveRecord::Base; end
class Customer < Person; end
class Employee < Person; end
class Developer < Employee; end
I.e., there are two levels of inheritance (Developer < Employee <
Person).
When creating a Customer, Rails understands
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 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
2006 Mar 22
2
Edge Rails (1.1.0 RC1) and Typo Trunk
I tried the current Typo trunk with Edge Rails (1.1.0 RC1) and ran
into the following problems:
1) /public/../config/environment.rb:107: undefined method
`enable_upload_progress'' for ActionController::Base:Class
(NoMethodError). I commented this line out and installed the Upload
Progress plugin and this problem _appears_ to have gone away.
2) The second problem I
2008 Nov 18
3
Code changes are ignored due to code minor ver. were cached
Hi there!
I study Ruby on Rails and met a problem.
I placed a class definition code for class which is NOT a Model into
separate file, assume MyToolClass.rb
Then I started working on controller code and required ''MyToolClass''
While working on controller code I also corrected some code in
MyToolClass.rb, but it seemed, that changes in MyTooolClass.rb were
ignored by Rails until
2006 May 26
2
Rails app fails to start with LoginGenerator
Hi guys
I was following this: <a
href="http://wiki.rubyonrails.com/rails/pages/LoginGenerator">tutorial</a>
and everything was perfect until I run the script.
I''ve got:
<strong>MissingSourceFile</strong><br />
no such file to load -- user.rb <br />
RAILS_ROOT: script/../config/.. <br />
<pre><code>
2006 Apr 11
9
Rails failure after upgrade to 1.1.2
Greetings,
I tried upgrading Rails to 1.1.2 and now nothing is really working. In
connection to the Rails upgrade I upgraded my Ruby version to 1.9.0. I
also upgraded all my gem installs.
Since my old rails apps stopped working I tried generating a fresh one
, alas with the same result. Below I included the full trace when
trying to reach the app. Line 3 in application.rb is :
class
2006 Feb 09
0
Extending ActiveRecord creates TypeError
.../lib/
active_support/dependencies.rb:178:in `require_dependency''
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/
active_support/dependencies.rb:178:in `require_dependency''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/
action_controller/dependencies.rb:72:in `require_dependencies''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/
action_controller/dependencies.rb:70:in `each''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/
action_controller/dependencies.rb:70:in `require_dependencies''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.1...
2005 Aug 10
1
using modules with models?
I''m trying to figure out how to use modules with my model classes.
I''m going to have good number of model classes that don''t map to the
database, and I''d like to put some of these in seperate modules. I''ve
been wrestling with this for 2 days and can''t figure out how to get it
to work. Rails seems to handle it fine for controllers, though.
I
2006 Jan 18
1
Another uninitialized constant question
Guys,
I''m trying to generate a scaffold to admin a table called hangars. I''d
like the controller to fall with an "admin" sub-module.
I used the command:
script/generate scaffold Hangar Admin::Hangar
This seemed to work, and placed the controller in
controllers/admin/hangar_controller.rb, where I expected to find it. It
also created the hangar.rb model in
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
2005 Mar 06
12
Where to place custom classes?
Hi all,
I am writing a simple shopping cart which will consist of a single
class. There will be no DB table for carts so I do not want to make my
Cart a model. But where do I place my Cart class so that I can access
it in my controllers?
I want to be able do do things like this (for instance in a shop
controller):
def add_to_cart
@session[''cart''].add(article_id, amount)
2006 Mar 25
1
Question about upgrading to rails rc1.1
My current under-developed project is using rails 1.0 and now plan to
upgrade to rails rc1.1,the project uses the Rails-engine and
Login-engine as the login module,when I update the rails according to
http://weblog.rubyonrails.org/articles/2006/03/22/rails-1-1-release-candidate-1-available
The project still can not be started,anybody can tell me the reason?very
thanksful!And following is the
2005 Dec 27
4
Using mocks
Hi,
What's the purpose of test/mocks? I couldn't quite complete the Wiki
entry on this because all the information I _could_ find was in the
readme.
- Rowan
--
Morality is usually taught by the immoral.
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
2008 Oct 16
5
2 Models: Same name, different namespace => Problems
Let''s start with an example:
---
class Comment < ActiveRecord::Base
end
# dummy (to invent a "table namespace")
class Review < ActiveRecord::Base
end
# ... dummy
# is "review_comments" in the database
class Review::Comment < ActiveRecord::Base
belongs_to :thing
end
class Review::Thing < ActiveRecord::Base
has_many :comments, :class_name =>