Claudius Nicolae
12 years ago
9 changed files with 48 additions and 8 deletions
@ -0,0 +1,8 @@ |
|||||||
|
class BlacklistedDomain < ActiveRecord::Base |
||||||
|
attr_accessible :name |
||||||
|
|
||||||
|
def self.include?(name) |
||||||
|
where("blacklisted_domains.name = ? OR ? LIKE CONCAT('%.', blacklisted_domains.name)", |
||||||
|
name, name).exists? |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,9 @@ |
|||||||
|
class CreateBlacklistedDomains < ActiveRecord::Migration |
||||||
|
def change |
||||||
|
create_table :blacklisted_domains do |t| |
||||||
|
t.string :name |
||||||
|
|
||||||
|
t.timestamps |
||||||
|
end |
||||||
|
end |
||||||
|
end |
@ -1,6 +0,0 @@ |
|||||||
# Read about factories at http://github.com/thoughtbot/factory_girl |
|
||||||
|
|
||||||
FactoryGirl.define do |
|
||||||
factory :admin do |
|
||||||
end |
|
||||||
end |
|
@ -0,0 +1,5 @@ |
|||||||
|
require 'spec_helper' |
||||||
|
|
||||||
|
describe BlacklistedDomain do |
||||||
|
pending "add some examples to (or delete) #{__FILE__}" |
||||||
|
end |
Loading…
Reference in new issue