<commit_before>= Not Only... But Also

The Rails 'fat model' pattern is a good one but can result in very large model classes. It can be
unwieldy to work in such files as they begin to look a bit messy. Assuming you have judiciously 
appraised the model for opportunities to extract out pieces into libraries, it still may leave you with
a lot of code. I find this is particularly the case for validations for models with a large number of columns.

This is where allowing for multiple files to define a class can help and is what NotOnlyButAlso does. It defines a
convention to help organise multiple files as well as avoiding the need for repititive code when using modules as
containers or re-opening the classes.
 
You might recognise this style of solution as used by the concerned_with plugin (http://github.com/jakehow/concerned_with/).
I wrote this a long time ago before I knew of the concerned_with plugin. I have released it because its got a simpler interface
and I love the name.

For interest here are some discussions of this type of solution in regards to concerned_with: 

http://m.onkey.org/2008/9/15/active-record-tips-and-tricks
http://paulbarry.com/articles/2008/08/30/concerned-with-skinny-controller-skinny-model

For extra credit:

http://en.wikipedia.org/wiki/Not_Only..._But_Also

== Install

  ./script/install plugin git://github.com/adzap/not_only_but_also.git

== Usage

For example you want to extract out the validations to a separate file:

  class Post
    not_only_but_also :validations
  end

  # in app/models/post/validations.rb

  Post.not_only_but_also do
    validates_presence_of :title
  end

OR the shorthand version:
<commit_msg>fix links<commit_after>= Not Only... But Also

The Rails 'fat model' pattern is a good one but can result in very large model classes. It can be
unwieldy to work in such files as they begin to look a bit messy. Assuming you have judiciously 
appraised the model for opportunities to extract out pieces into libraries, it still may leave you with
a lot of code. I find this is particularly the case for validations for models with a large number of columns.

This is where allowing for multiple files to define a class can help and is what NotOnlyButAlso does. It defines a
convention to help organise multiple files as well as avoiding the need for repititive code when using modules as
containers or re-opening the classes.
 
You might recognise this style of solution as used by the concerned_with plugin (http://github.com/jakehow/concerned_with/).
I wrote this a long time ago before I knew of the concerned_with plugin. I have released it because its got a simpler interface
and I love the name.

For interest here are some discussions of this type of solution in regards to concerned_with: 

http://m.onkey.org/2008/9/15/active-record-tips-and-tricks

http://paulbarry.com/articles/2008/08/30/concerned-with-skinny-controller-skinny-model

For extra credit:

http://en.wikipedia.org/wiki/Not_Only..._But_Also

== Install

  ./script/install plugin git://github.com/adzap/not_only_but_also.git

== Usage

For example you want to extract out the validations to a separate file:

  class Post
    not_only_but_also :validations
  end

  # in app/models/post/validations.rb

  Post.not_only_but_also do
    validates_presence_of :title
  end

OR the shorthand version:

{'fraction_non_alphanumeric': 0.055007473841554556, 'fraction_numerical': 0.008968609865470852, 'mean_word_length': 4.016491754122939, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6087828', 'n_tokens_mistral': 989, 'n_tokens_neox': 930, 'n_words': 449}