lib/x-editable-rails/configuration.rb in x-editable-rails-1.5.0 vs lib/x-editable-rails/configuration.rb in x-editable-rails-1.5.1
- old
+ new
@@ -15,23 +15,17 @@
def class_options
options.fetch(:class_options, {})
end
def options
- default_options.deep_merge custom_options
- end
-
- def default_options
- @defaults ||= begin
- options = load_yaml_file File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "config", "x-editable.yml"))
- format_class_options! options
- end
- end
-
- def custom_options
- @custom_options ||= begin
- options = load_yaml_file ::Rails.root.join("config", "x-editable.yml")
- format_class_options! options
+ config_fn = ::Rails.root.join("config", "x-editable.yml")
+ if File.file?(config_fn)
+ @options ||= begin
+ options = load_yaml_file config_fn
+ format_class_options! options
+ end
+ else
+ @options = {}
end
end
def load_yaml_file(path)
source = File.read path
\ No newline at end of file