Class: Marsdawn::Storage::ActiveRecord::Marsdawn
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Marsdawn::Storage::ActiveRecord::Marsdawn
- Defined in:
- lib/marsdawn/storage/active_record/marsdawn.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#lang ⇒ Object
Returns the value of attribute lang.
-
#uri ⇒ Object
Returns the value of attribute uri.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/marsdawn/storage/active_record/marsdawn.rb', line 5 def data @data end |
#doc ⇒ Object
Returns the value of attribute doc.
5 6 7 |
# File 'lib/marsdawn/storage/active_record/marsdawn.rb', line 5 def doc @doc end |
#lang ⇒ Object
Returns the value of attribute lang.
5 6 7 |
# File 'lib/marsdawn/storage/active_record/marsdawn.rb', line 5 def lang @lang end |
#uri ⇒ Object
Returns the value of attribute uri.
5 6 7 |
# File 'lib/marsdawn/storage/active_record/marsdawn.rb', line 5 def uri @uri end |
#version ⇒ Object
Returns the value of attribute version.
5 6 7 |
# File 'lib/marsdawn/storage/active_record/marsdawn.rb', line 5 def version @version end |
Class Method Details
.create_unless_exists ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/marsdawn/storage/active_record/marsdawn.rb', line 7 def self.create_unless_exists unless ActiveRecord::Base.connection.table_exists? self.table_name ActiveRecord::Migration.create_table :marsdawn do |t| t.string :doc, :null => false t.string :lang, :null => false t.string :version, :null => false t.string :uri, :null => false t.text :data end ActiveRecord::Migration.add_index :marsdawn, [:doc, :lang, :version, :uri], :unique => true end end |