<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: How To Handle Model In Module?</title>
	<atom:link href="http://www.valibuk.net/2007/02/how-to-handle-model-in-module/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.valibuk.net/2007/02/how-to-handle-model-in-module/</link>
	<description>A place for opinions and notes of a valibuk.</description>
	<pubDate>Tue, 07 Feb 2012 22:10:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Daicoden</title>
		<link>http://www.valibuk.net/2007/02/how-to-handle-model-in-module/#comment-25798</link>
		<dc:creator>Daicoden</dc:creator>
		<pubDate>Sun, 21 Oct 2007 18:13:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.valibuk.net/?p=43#comment-25798</guid>
		<description>If you do that you screw up name spaces!

Is it possible to do

library/
  book.rb
bookstore/
  book.rb

and actually get it to work right?</description>
		<content:encoded><![CDATA[<p>If you do that you screw up name spaces!</p>
<p>Is it possible to do</p>
<p>library/<br />
  book.rb<br />
bookstore/<br />
  book.rb</p>
<p>and actually get it to work right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MatthewRudy</title>
		<link>http://www.valibuk.net/2007/02/how-to-handle-model-in-module/#comment-8229</link>
		<dc:creator>MatthewRudy</dc:creator>
		<pubDate>Sun, 03 Jun 2007 20:03:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.valibuk.net/?p=43#comment-8229</guid>
		<description>I think you made this too hard for yourself.
Unless you were duplicating model names
eg. First::Model, and Second::Model,
you probably just wanted to keep your models in different directories.

so your app/models directory looks like;
first/
    alpha.rb
    beta.rb
    gamma.rb
second/
    one.rb
    two.rb
    three.rb

Rails will automatically expect second/one.rb to define Second::One.
however, you could just add "#{RAILS_ROOT}/app/models/second" to your load path in environment.rb
In this case, it'll just look in these additional directories for normal models.
(the test files you can sort as you want, same with fixtures)

"config.load_paths += %W( #{path1} #{path2} )" would do it.</description>
		<content:encoded><![CDATA[<p>I think you made this too hard for yourself.<br />
Unless you were duplicating model names<br />
eg. First::Model, and Second::Model,<br />
you probably just wanted to keep your models in different directories.</p>
<p>so your app/models directory looks like;<br />
first/<br />
    alpha.rb<br />
    beta.rb<br />
    gamma.rb<br />
second/<br />
    one.rb<br />
    two.rb<br />
    three.rb</p>
<p>Rails will automatically expect second/one.rb to define Second::One.<br />
however, you could just add &#8220;#{RAILS_ROOT}/app/models/second&#8221; to your load path in environment.rb<br />
In this case, it&#8217;ll just look in these additional directories for normal models.<br />
(the test files you can sort as you want, same with fixtures)</p>
<p>&#8220;config.load_paths += %W( #{path1} #{path2} )&#8221; would do it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

