Class: Spectacles::MaterializedView
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spectacles::MaterializedView
- Defined in:
- lib/spectacles/materialized_view.rb
Class Method Summary collapse
- .materialized_view_exists? ⇒ Boolean (also: table_exists?)
- .new ⇒ Object
- .refresh! ⇒ Object
Instance Method Summary collapse
Class Method Details
.materialized_view_exists? ⇒ Boolean Also known as: table_exists?
9 10 11 |
# File 'lib/spectacles/materialized_view.rb', line 9 def self.materialized_view_exists? self.connection.materialized_view_exists?(self.view_name) end |
.new ⇒ Object
5 6 7 |
# File 'lib/spectacles/materialized_view.rb', line 5 def self.new(*) raise NotImplementedError end |
.refresh! ⇒ Object
13 14 15 |
# File 'lib/spectacles/materialized_view.rb', line 13 def self.refresh! self.connection.refresh_materialized_view(self.view_name) end |
Instance Method Details
#==(comparison_object) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/spectacles/materialized_view.rb', line 22 def ==(comparison_object) super || comparison_object.instance_of?(self.class) && attributes.present? && comparison_object.attributes == attributes end |
#persisted? ⇒ Boolean
29 30 31 |
# File 'lib/spectacles/materialized_view.rb', line 29 def persisted? false end |
#readonly? ⇒ Boolean
33 34 35 |
# File 'lib/spectacles/materialized_view.rb', line 33 def readonly? true end |