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
SELECT "users".* FROM "users" | |
INNER JOIN "addresses" ON "addresses"."user_id" = "users"."id" | |
INNER JOIN "addresses" "countries_users_join" ON "users"."id" = "countries_users_join"."user_id" | |
INNER JOIN "countries" ON "countries"."id" = "countries_users_join"."country_id" | |
INNER JOIN "interests_users" ON "users"."id" = "interests_users"."user_id" | |
INNER JOIN "interests" ON "interests"."id" = "interests_users"."interest_id" | |
WHERE | |
("users"."level" BETWEEN 1 AND 45) | |
AND ("users"."date_of_birth" BETWEEN '1986-02-09' AND '1991-02-09') | |
AND ("countries"."title" ILIKE '%d%') |
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
desc <<END | |
Find all html files from the specified directory and clean them: removes comments, whitespaces, and carriage return. | |
Before using install loofah gem: | |
gem install loofah | |
Usage: | |
rake clean_html DIR=my_dir | |
Warning: by default, DIR variable point current directory - #{Dir.pwd} |
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
en: | |
name: | |
first: Andrey | |
last: Samsonov | |
email: '[email protected]' | |
github: 'https://github.com/kryzhovnik' | |
phone: '+7(927)695-8-444' | |
skype: 'andrey.samsonov' | |
country: Russia | |
city: Samara |
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
class InclusionWithBlockValidator < ActiveModel::EachValidator | |
def validate_each(object, attribute, value) | |
begin | |
enum = options[:in].call | |
raise unless enum.kind_of?(Enumerable) | |
rescue | |
raise "value of :in option at inclusion_with_block validator " + | |
"must be a block those return enumerable object" | |
end | |
unless enum.include?(value) |
NewerOlder