Browse Source

add lxd_host model

master
Georg Hopp 10 years ago
parent
commit
f91049845a
  1. 3
      app/models/lxd_host.rb
  2. 11
      db/migrate/20160419090228_create_lxd_hosts.rb
  3. 11
      test/fixtures/lxd_hosts.yml
  4. 7
      test/models/lxd_host_test.rb

3
app/models/lxd_host.rb

@ -0,0 +1,3 @@
class LxdHost < ActiveRecord::Base
has_secure_password
end

11
db/migrate/20160419090228_create_lxd_hosts.rb

@ -0,0 +1,11 @@
class CreateLxdHosts < ActiveRecord::Migration
def change
create_table :lxd_hosts do |t|
t.text :name
t.text :uri
t.string :password_digest
t.timestamps null: false
end
end
end

11
test/fixtures/lxd_hosts.yml

@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
name: MyText
uri: MyText
password_digest: <%= BCrypt::Password.create('secret') %>
two:
name: MyText
uri: MyText
password_digest: <%= BCrypt::Password.create('secret') %>

7
test/models/lxd_host_test.rb

@ -0,0 +1,7 @@
require 'test_helper'
class LxdHostTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
Loading…
Cancel
Save