Class: Breeze::SharedBase
- Inherits:
-
ActiveYaml
- Object
- ActiveYaml
- Breeze::SharedBase
- Defined in:
- app/models/breeze/shared_base.rb
Overview
shared data across engine and app takes a little footwork, as seen below and does not work with saving anymore.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from ActiveYaml
Class Method Summary collapse
Methods inherited from ActiveYaml
all, append, define_access, define_association, delete, fields, find, find_all, find_by, first, full_path, #id, #id=, #initialize, #persisted?, primary_key, reload, save_all, set_root_path, the_meta_class
Constructor Details
This class inherits a constructor from Breeze::ActiveYaml
Class Method Details
.load_file ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/models/breeze/shared_base.rb', line 8 def self.load_file # does super work ? Copied, wet wet wet mod , filename = self.name.split("::").collect{|p| p.underscore} fullname = mod + "/" + filename.tableize + ".yml" res = YAML.load(File.read(File.join(self.path , fullname ))) breeze_path = Breeze::Engine.root.join("config") breeze_res = YAML.load(File.read(File.join(breeze_path , fullname ))) res + breeze_res end |