diff options
author | HombreLaser <sebastian-440@live.com> | 2023-03-25 00:15:52 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2023-03-25 00:15:52 -0600 |
commit | 7b5d00f1bf262cc40b6b9dc21bb42e2dc7c80afe (patch) | |
tree | 0995c27ab14d62171bb4372e83b71400187b72b1 | |
parent | 7265af094ed16c36632128bccdcf84a3796c2359 (diff) |
Añade modelo Card
-rw-r--r-- | app/models/card.rb | 3 | ||||
-rw-r--r-- | db/migrate/20230325061452_create_cards.rb | 14 | ||||
-rw-r--r-- | spec/models/card_spec.rb | 5 |
3 files changed, 22 insertions, 0 deletions
diff --git a/app/models/card.rb b/app/models/card.rb new file mode 100644 index 0000000..ae2b1e5 --- /dev/null +++ b/app/models/card.rb @@ -0,0 +1,3 @@ +class Card < ApplicationRecord + belongs_to :user_account +end diff --git a/db/migrate/20230325061452_create_cards.rb b/db/migrate/20230325061452_create_cards.rb new file mode 100644 index 0000000..6e06e36 --- /dev/null +++ b/db/migrate/20230325061452_create_cards.rb @@ -0,0 +1,14 @@ +class CreateCards < ActiveRecord::Migration[7.0] + def change + create_table :cards do |t| + t.string :number + t.integer :expiration_month + t.integer :expiration_year + t.integer :expiration_day + t.integer :security_code + t.references :user_account, null: false, foreign_key: true + + t.timestamps + end + end +end diff --git a/spec/models/card_spec.rb b/spec/models/card_spec.rb new file mode 100644 index 0000000..6f49b4a --- /dev/null +++ b/spec/models/card_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Card, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end |