This file contains 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
PostgreSQL 9.1.4 on x86_64-apple-darwin11.3.1, compiled by Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn), 64-bit | |
ALTER TABLE users ADD COLUMN tsv tsvector; | |
UPDATE users SET tsv = (to_tsvector('english', coalesce("users"."email"::text, '')) || | |
to_tsvector('english', coalesce("users"."username"::text, '')) || | |
to_tsvector('english', coalesce("users"."first_name"::text, '')) || | |
to_tsvector('english', coalesce("users"."last_name"::text, ''))); | |
(is this trigger the same as the update above, or do I need my own function?) |
This file contains 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
class User < ActiveRecord::Base | |
# == Constants ============================================================ | |
GENDERS = [[‘Male’, ‘m’], [‘Female’, ’f’]].freeze | |
# == Attributes =========================================================== | |
# paperclip | |
attr_accessor :remove_logo |