Created
November 22, 2010 08:14
-
-
Save deepak/709663 to your computer and use it in GitHub Desktop.
went on a refactoring/beautification overdrive just so that the lines are under 80 columns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# went on a refactoring/beautification overdrive just so that the lines are under 80 columns | |
# ruby statements that overflow into the next row are an abomination :-) | |
# mangled production-code to remove const-names. It is not production or even code which has been run before | |
# please refactor!! | |
# * Any better way to make sure the long condition string is properly formatted | |
# * the gsub(/\s/, '') is also suspect as it would replace spaces etc in a proper sql | |
Comment.count(:id, | |
:include => [:person, :had_commented], | |
:conditions => [<<-SQL.gsub(/\s/, '') | |
status in (?) | |
and #{Person.table_name}.status = ? | |
and #{HadCommented.table_name}.created_at >= current() - 10 | |
SQL | |
].insert(-1, | |
BlogStatus::STATUS_NAMES.values_at(:pending, :flag), | |
'registered')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment