Module: MassiveRecord::ORM::Persistence::ClassMethods
- Defined in:
- lib/massive_record/orm/persistence.rb
Instance Method Summary collapse
- #create(*args) ⇒ Object
- #destroy_all ⇒ Object
-
#ensure_that_we_have_table_and_column_families! ⇒ Object
Iterates over tables and column families and ensure that we have what we need.
Instance Method Details
#create(*args) ⇒ Object
8 9 10 11 12 |
# File 'lib/massive_record/orm/persistence.rb', line 8 def create(*args) new(*args).tap do |record| record.save end end |
#destroy_all ⇒ Object
14 15 16 |
# File 'lib/massive_record/orm/persistence.rb', line 14 def destroy_all all.each { |record| record.destroy } end |
#ensure_that_we_have_table_and_column_families! ⇒ Object
Iterates over tables and column families and ensure that we have what we need
23 24 25 26 27 28 29 |
# File 'lib/massive_record/orm/persistence.rb', line 23 def ensure_that_we_have_table_and_column_families! # :nodoc: # # TODO: Can we skip checking if it exists at all, and instead, rescue it if it does not? # hbase_create_table! unless table.exists? raise ColumnFamiliesMissingError.new(self, calculate_missing_family_names) if calculate_missing_family_names.any? end |