Class: Spectacles::View

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/spectacles/view.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.newObject

Raises:

  • (NotImplementedError)


5
6
7
# File 'lib/spectacles/view.rb', line 5

def self.new(*)
  raise NotImplementedError, "#{self} is an abstract class and cannot be instantiated."
end

.view_exists?Boolean Also known as: table_exists?



9
10
11
# File 'lib/spectacles/view.rb', line 9

def self.view_exists?
  connection.view_exists?(view_name)
end

Instance Method Details

#==(other) ⇒ Object



18
19
20
21
22
23
# File 'lib/spectacles/view.rb', line 18

def ==(other)
  super ||
    other.instance_of?(self.class) &&
      attributes.present? &&
      other.attributes == attributes
end

#persisted?Boolean



25
26
27
# File 'lib/spectacles/view.rb', line 25

def persisted?
  false
end

#readonly?Boolean



29
30
31
# File 'lib/spectacles/view.rb', line 29

def readonly?
  true
end