added constraint for fav search

This commit is contained in:
albert
2011-11-16 13:12:02 -05:00
parent 710d584ec6
commit cce3fe0b64
10 changed files with 4 additions and 96 deletions

View File

@@ -1,7 +0,0 @@
/*
*= require "smoothness/jquery-ui-1.8.5.custom.css"
*= require_self
*= require_tree "./common"
*= require_tree "./specific"
*= require_tree "./mobile"
*/

View File

@@ -1,7 +0,0 @@
$h1_size: 4em;
$h2_size: 3em;
$h3_size: 2em;
$h1_padding: 1.25em 0;
$h2_padding: 1.45833em 0;
$h3_padding: 1.51785em 0;
$baseline: 1em;

View File

@@ -1,10 +0,0 @@
h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, cite, code, del, dfn, em, img, q, s, samp, small, strike, strong, sub, sup, tt, var, dd, dl, dt, li, ol, ul, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
/* font-weight: normal;*/
font-style: normal;
font-size: 130%;
line-height: 1.25em;
font-family: inherit;
}

View File

@@ -1,9 +0,0 @@
div#page {
aside#sidebar {
width: 30%;
}
section#content {
width: 65%;
}
}

View File

@@ -1,13 +0,0 @@
@import "../common/000_vars.css.scss";
header#top {
h1 {
margin: 5px 30px 0 30px;
}
menu {
li.nonessential {
display: none;
}
}
}

View File

@@ -1,14 +0,0 @@
@import "../common/000_vars.css.scss";
div.paginator {
font-weight: bold;
li {
margin: 1em 0;
}
a, span {
padding: 0.5em 1em;
font-weight: bold;
}
}

View File

@@ -1,32 +0,0 @@
@import "../common/000_vars.css.scss";
div#c-posts {
section#mode-box {
display: none;
}
section#tag-box {
ul {
font-weight: bold;
li {
margin: 0.5em 0;
}
}
}
a.search-tag {
}
a.search-inc-tag {
display: none;
}
a.search-exl-tag {
display: none;
}
span.post-count {
display: none;
}
}

View File

@@ -1,4 +1,4 @@
class Favorite < ActiveRecord::Base
belongs_to :post
scope :for_user, lambda {|user_id| where("user_id = #{user_id}")}
scope :for_user, lambda {|user_id| where("user_id % 100 = #{user_id.to_i % 100} and user_id = #{user_id.to_i}")}
end

View File

@@ -176,7 +176,7 @@ class User < ActiveRecord::Base
module FavoriteMethods
def favorites
Favorite.where("user_id = ?", id).order("id desc")
Favorite.where("user_id % 100 = #{id % 100} and user_id = #{id}").order("id desc")
end
def add_favorite!(post)

View File

@@ -3043,7 +3043,7 @@ drop function trg_posts_tags__insert();
alter table post_appeals rename column user_id to creator_id;
alter index index_post_appeals_on_user_id rename to index_post_appeals_on_creator_id;
alter table post_appeals rename column ip_addr to creator_ip_addr;
alter index index_post_appeals_on_ip_addr to index_post_appeals_on_creator_ip_addr;
alter index index_post_appeals_on_ip_addr rename to index_post_appeals_on_creator_ip_addr;
create index index_post_flags_on_creator_id on post_flags (creator_id);
create index index_post_flags_on_creator_ip_addr on post_flags (creator_ip_addr);
@@ -3146,7 +3146,7 @@ alter table users add column favorite_count integer not null default 0;
alter table users add column post_upload_count integer not null default 0;
alter table users drop column invite_count;
alter table users alter column last_logged_in_at drop not null;
alter table users alter column last_forum_at drop not null;
alter table users alter column last_forum_read_at drop not null;
alter table users rename column upload_limit to base_upload_limit;
alter table users drop column uploaded_tags;
alter index idx_users__name rename to index_users_on_name;