Created
June 12, 2014 21:11
-
-
Save kastner/32454a051cc427597174 to your computer and use it in GitHub Desktop.
enum!
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
#!/usr/bin/env ruby | |
require 'active_record' | |
class Thing < ActiveRecord::Base | |
belongs_to :group | |
enum number: [:a, :b] | |
end | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Base.establish_connection( | |
:adapter => "sqlite3", | |
:database => ":memory:" | |
) | |
ActiveRecord::Schema.define do | |
create_table :things do |t| | |
t.integer :number | |
end | |
end | |
puts Thing.a.inspect |
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
gem 'activerecord', '4.0' | |
gem 'sqlite3' |
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
gem 'activerecord', '4.1' | |
gem 'sqlite3' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment