parent
e13cbaef60
commit
95e1bc759c
@ -0,0 +1,8 @@
|
||||
class Openi < ActiveRecord::Base
|
||||
attr_accessible :allow, :avatar_url, :email, :login, :name, :openi_user_id, :user_id
|
||||
belongs_to :user
|
||||
|
||||
def self.find_by_login(login)
|
||||
Openi.where(login: login).first
|
||||
end
|
||||
end
|
@ -0,0 +1,15 @@
|
||||
class CreateOpenis < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :openis do |t|
|
||||
t.integer :user_id
|
||||
t.integer :openi_user_id
|
||||
t.string :login
|
||||
t.string :avatar_url
|
||||
t.string :name
|
||||
t.string :email
|
||||
t.integer :allow
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,11 @@
|
||||
FactoryGirl.define do
|
||||
factory :openi do
|
||||
user_id 1
|
||||
openi_user_id 1
|
||||
login "MyString"
|
||||
avatar_url "MyString"
|
||||
name "MyString"
|
||||
email "MyString"
|
||||
allow 1
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Openi, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in new issue