This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| addBlock: function(state, block) { | |
| // It automatically adds a product block on initial load | |
| // Don't add first block if blocks already exist in db | |
| if (state.blocks.length > 0) { | |
| var blocks = []; | |
| for(var i = 0; i < block.grid_columns_number; i++){ | |
| var addBlock = _.cloneDeep(block); | |
| var position = i; | |
| if (!_.isEmpty(_.flatten(state.blocks))) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rake::Task["db:structure:dump"].clear | |
| namespace :db do | |
| namespace :structure do | |
| desc 'Dump the database structure to db/structure.sql. Specify another file with DB_STRUCTURE=db/my_structure.sql' | |
| task :dump => [:environment, :load_config] do | |
| config = current_config | |
| filename = ENV['DB_STRUCTURE'] || File.join(Rails.root, "db", "structure.sql") | |
| case config['adapter'] | |
| when /mysql/, 'oci', 'oracle' | |
| ActiveRecord::Base.establish_connection(config) |