Class: ActiveRecord::DatabaseViews::ViewCollection
- Inherits:
-
Object
- Object
- ActiveRecord::DatabaseViews::ViewCollection
- Includes:
- Enumerable
- Defined in:
- lib/activerecord-database-views/view_collection.rb
Constant Summary collapse
- MISSING_RELATION_REGEX =
/relation \"(.*)\" does not exist/
Instance Attribute Summary collapse
-
#views ⇒ Object
readonly
Returns the value of attribute views.
Instance Method Summary collapse
- #drop! ⇒ Object
-
#initialize ⇒ ViewCollection
constructor
A new instance of ViewCollection.
- #load! ⇒ Object
Constructor Details
#initialize ⇒ ViewCollection
Returns a new instance of ViewCollection.
11 12 13 |
# File 'lib/activerecord-database-views/view_collection.rb', line 11 def initialize @views = view_paths.map { |path| View.new(path) } end |
Instance Attribute Details
#views ⇒ Object (readonly)
Returns the value of attribute views.
7 8 9 |
# File 'lib/activerecord-database-views/view_collection.rb', line 7 def views @views end |
Instance Method Details
#drop! ⇒ Object
15 16 17 |
# File 'lib/activerecord-database-views/view_collection.rb', line 15 def drop! each(&:drop!) end |
#load! ⇒ Object
19 20 21 |
# File 'lib/activerecord-database-views/view_collection.rb', line 19 def load! load_view(first) while first end |