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
require 'open-uri' | |
require 'angellist_api' | |
require 'mongoid' | |
# Load the Startup model | |
require File.expand_path(File.dirname(__FILE__) + '/app/models/startup') | |
Mongoid.load!('config/mongoid.yml', :development) | |
page = 1 | |
startup_ids = [] |
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
module BitmaskOptions | |
extend ActiveSupport::Concern | |
include ActiveModel::Serialization | |
included do | |
mattr_accessor :all_options, :all_option_pairs, instance_writer: false | |
end | |
# This is a low level method that usually won't be used in public methods | |
#http://railscasts.com/episodes/189-embedded-association |
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
require 'spec_helper' | |
shared_examples_for 'bitmask_options' do | |
# http://stackoverflow.com/questions/16525222/how-to-test-a-concern-in-rails#answer-20010923 | |
# http://stackoverflow.com/questions/25562639/rspec-testing-ar-model-concern-within-described-class-or-dummyclass | |
let(:model) { described_class } # the class that includes the concern | |
has_attributes :bitmask_options | |
it 'has at least one option' do |
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
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |