Krunal Shah wrote:
> # file foo.rb
> class Foo < ActiveRecord::Base
>   include FooMethods
>   # --- validations --- #
>   # --- relationships --- #
>   belongs_to :foobar
>   has_many   :bars
> 
>   # --- Class Methods --- #
>   def Foo.a_method_name(id)
>     ...
>   end
> end
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> # file foo_methods.rb
> 
> module FooMethods
> 
>   def method1
>     ...
>   end
> 
>   def method2
>    ...
>   end
> 
> end
> 
> 
> If i will create a new module for every model to separate my validation 
> and logic part. Than will it help anyway in load and other things?

Don't bother.  It's a completely pointless idea.  Splitting your models 
into 2 files will provide no performance or architectural benefits that 
I can see, and will make your code harder to read.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to