Module: Tienda
- Defined in:
- lib/tienda.rb,
lib/tienda/error.rb,
lib/tienda/engine.rb,
lib/tienda/version.rb,
lib/tienda/settings.rb,
app/models/tienda/user.rb,
app/models/tienda/order.rb,
lib/tienda/view_helpers.rb,
app/models/tienda/country.rb,
app/models/tienda/payment.rb,
app/models/tienda/product.rb,
app/models/tienda/setting.rb,
lib/tienda/orderable_item.rb,
app/models/tienda/tax_rate.rb,
lib/tienda/settings_loader.rb,
lib/tienda/setup_generator.rb,
lib/tienda/country_importer.rb,
app/models/tienda/order_item.rb,
lib/tienda/navigation_manager.rb,
app/mailers/tienda/user_mailer.rb,
app/models/tienda/order/states.rb,
app/mailers/tienda/order_mailer.rb,
app/models/tienda/order/actions.rb,
app/models/tienda/order/billing.rb,
app/models/tienda/product_image.rb,
lib/tienda/associated_countries.rb,
lib/tienda/errors/refund_failed.rb,
app/models/tienda/order/delivery.rb,
app/models/tienda/delivery_service.rb,
app/models/tienda/product/variants.rb,
app/models/tienda/product_category.rb,
lib/tienda/errors/not_enough_stock.rb,
lib/tienda/errors/payment_declined.rb,
lib/tienda/errors/unorderable_item.rb,
app/models/tienda/product_attribute.rb,
app/uploaders/tienda/image_uploader.rb,
app/helpers/tienda/application_helper.rb,
app/controllers/tienda/users_controller.rb,
lib/tienda/errors/invalid_configuration.rb,
app/controllers/tienda/orders_controller.rb,
app/models/tienda/delivery_service_price.rb,
app/models/tienda/stock_level_adjustment.rb,
app/controllers/tienda/payments_controller.rb,
app/controllers/tienda/products_controller.rb,
app/controllers/tienda/sessions_controller.rb,
app/controllers/tienda/settings_controller.rb,
app/controllers/tienda/variants_controller.rb,
app/controllers/tienda/countries_controller.rb,
app/controllers/tienda/dashboard_controller.rb,
app/controllers/tienda/tax_rates_controller.rb,
app/uploaders/tienda/product_image_uploader.rb,
app/helpers/tienda/product_categories_helper.rb,
app/models/tienda/product/product_attributes.rb,
app/uploaders/tienda/category_image_uploader.rb,
app/controllers/tienda/application_controller.rb,
app/controllers/tienda/attachments_controller.rb,
lib/tienda/errors/insufficient_stock_to_fulfil.rb,
lib/tienda/errors/inappropriate_delivery_service.rb,
app/controllers/tienda/delivery_services_controller.rb,
app/controllers/tienda/product_categories_controller.rb,
app/controllers/tienda/delivery_service_prices_controller.rb,
app/controllers/tienda/stock_level_adjustments_controller.rb
Defined Under Namespace
Modules: ApplicationHelper, AssociatedCountries, CountryImporter, Errors, OrderableItem, ProductCategoriesHelper, ViewHelpers Classes: ApplicationController, AttachmentsController, CategoryImageUploader, CountriesController, Country, DashboardController, DeliveryService, DeliveryServicePrice, DeliveryServicePricesController, DeliveryServicesController, Engine, Error, ImageUploader, NavigationManager, Order, OrderItem, OrderMailer, OrdersController, Payment, PaymentsController, Product, ProductAttribute, ProductCategoriesController, ProductCategory, ProductImage, ProductImageUploader, ProductsController, SessionsController, Setting, Settings, SettingsController, SettingsLoader, SetupGenerator, StockLevelAdjustment, StockLevelAdjustmentsController, TaxRate, TaxRatesController, User, UserMailer, UsersController, VariantsController
Constant Summary collapse
- VERSION =
'2.1.3'
Class Method Summary collapse
-
.add_settings_group(group, fields = []) ⇒ Object
Defines a new set of settings which should be configrable from the settings page in the Tienda UI.
-
.reset_settings ⇒ NilClass
Clears the settings from the thread cache so they will be taken from the database on next access.
-
.root ⇒ String
The path to the root of the Tienda application.
-
.settings ⇒ Tienda::Settings
Tienda settings as configured in the database.
-
.settings_groups ⇒ Hash
All settings groups which are available for configuration on the settings page.
Class Method Details
.add_settings_group(group, fields = []) ⇒ Object
Defines a new set of settings which should be configrable from the settings page in the Tienda UI.
40 41 42 43 |
# File 'lib/tienda.rb', line 40 def add_settings_group(group, fields = []) settings_groups[group] ||= [] settings_groups[group] = settings_groups[group] | fields end |
.reset_settings ⇒ NilClass
Clears the settings from the thread cache so they will be taken from the database on next access
34 35 36 |
# File 'lib/tienda.rb', line 34 def reset_settings Thread.current[:tienda_settings] = nil end |
.root ⇒ String
The path to the root of the Tienda application
19 20 21 |
# File 'lib/tienda.rb', line 19 def root File.('../../', __FILE__) end |
.settings ⇒ Tienda::Settings
Tienda settings as configured in the database
26 27 28 |
# File 'lib/tienda.rb', line 26 def settings Thread.current[:tienda_settings] ||= Tienda::Settings.new(Tienda::Setting.to_hash) end |
.settings_groups ⇒ Hash
All settings groups which are available for configuration on the settings page.
48 49 50 |
# File 'lib/tienda.rb', line 48 def settings_groups @settings_groups ||= {} end |