Skip to content

Commit

Permalink
added BandangoConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
macool committed Jan 15, 2014
1 parent aaf6170 commit e404695
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/bandango.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ class Bandango < ActiveRecord::Base
# relationships
belongs_to :business
has_many :transacciones
has_many :connections, class_name: BandangoConnection

end
19 changes: 19 additions & 0 deletions app/models/bandango_connection.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# == Schema Information
#
# Table name: bandango_connections
#
# id :integer not null, primary key
# bandango_id :integer not null
# transacciones_sent :text
# created_at :datetime
#

class BandangoConnection < ActiveRecord::Base

# relationships
belongs_to :bandango

# serializations
serialize :transacciones_sent, Array

end
10 changes: 10 additions & 0 deletions db/migrate/20140115175237_create_bandango_connections.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateBandangoConnections < ActiveRecord::Migration
def change
create_table :bandango_connections do |t|
t.references :bandango, null: false
t.text :transacciones_sent
t.datetime :created_at
end
add_index :bandango_connections, :bandango_id
end
end
10 changes: 9 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20140114054938) do
ActiveRecord::Schema.define(version: 20140115175237) do

create_table "bandango_connections", force: true do |t|
t.integer "bandango_id", null: false
t.text "transacciones_sent"
t.datetime "created_at"
end

add_index "bandango_connections", ["bandango_id"], name: "index_bandango_connections_on_bandango_id", using: :btree

create_table "bandangos", force: true do |t|
t.integer "business_id", null: false
Expand Down

0 comments on commit e404695

Please sign in to comment.