Skip to content

Commit

Permalink
Fixing a merge conflict with Gemfile.lock file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos León committed Nov 22, 2011
2 parents b61ba1c + d6b7222 commit 8a35177
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ config/database.yml
config/newrelic.yml
db/*.sqlite3
public/minified/*
public/stylesheets/*
.bundle/environment.rb
vendor/cache/*
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ GEM
thor (~> 0.14)
json (1.6.1)
libv8 (3.3.10.4)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
Expand Down
10 changes: 6 additions & 4 deletions app/models/scenario.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def clone_for(new_user)
def clone_variables_for(scenario)
query = <<-SQL
INSERT INTO `variables` (`name`, `display_name`, `description`, `unit_si`, `unit_ip`, `si_to_ip`, `left_label`, `right_label`, `subsection`, `zone_position`, `fault_widget_type`, `notes`, `component_code`, `io_type`, `view_type`, `index`, `lock_version`, `node_sequence`, `low_value`, `high_value`, `initial_value`, `is_fault`, `is_percentage`, `disabled`, `fault_is_active`, `type`, `scenario_id`)
SELECT `name`, `display_name`, `description`, `unit_si`, `unit_ip`, `si_to_ip`, `left_label`, `right_label`, `subsection`, `zone_position`, `fault_widget_type`, `notes`, `component_code`, `io_type`, `view_type`, `index`, `lock_version`, `node_sequence`, `low_value`, `high_value`, `initial_value`, `is_fault`, `is_percentage`, `disabled`, `fault_is_active`, `type`, #{scenario.id} FROM `variables` WHERE `variables`.`scenario_id` = #{id} AND `variables`.`type` IN ('ScenarioVariable')
SELECT `name`, `display_name`, `description`, `unit_si`, `unit_ip`, `si_to_ip`, `left_label`, `right_label`, `subsection`, `zone_position`, `fault_widget_type`, `notes`, `component_code`, `io_type`, `view_type`, `index`, `lock_version`, `node_sequence`, `low_value`, `high_value`, `initial_value`, `is_fault`, `is_percentage`, `disabled`, `fault_is_active`, 'ScenarioVariable', #{scenario.id} FROM `variables` WHERE `variables`.`scenario_id` = #{id} AND `variables`.`type` IN ('ScenarioVariable')
SQL
ActiveRecord::Base.connection.execute query
scenario.variables
Expand All @@ -69,9 +69,11 @@ def set_client_version

def copy_variables
return if is_a_clone?
master_scenario.variables.each do |sys_var|
variables.create sys_var.attributes.except("id", "created_at", "updated_at", "scenario_id")
end
query = <<-SQL
INSERT INTO `variables` (`name`, `display_name`, `description`, `unit_si`, `unit_ip`, `si_to_ip`, `left_label`, `right_label`, `subsection`, `zone_position`, `fault_widget_type`, `notes`, `component_code`, `io_type`, `view_type`, `index`, `lock_version`, `node_sequence`, `low_value`, `high_value`, `initial_value`, `is_fault`, `is_percentage`, `disabled`, `fault_is_active`, `type`, `scenario_id`)
SELECT `name`, `display_name`, `description`, `unit_si`, `unit_ip`, `si_to_ip`, `left_label`, `right_label`, `subsection`, `zone_position`, `fault_widget_type`, `notes`, `component_code`, `io_type`, `view_type`, `index`, `lock_version`, `node_sequence`, `low_value`, `high_value`, `initial_value`, `is_fault`, `is_percentage`, `disabled`, `fault_is_active`, 'ScenarioVariable', #{id} FROM `variables` WHERE `variables`.`scenario_id` = #{master_scenario_id} AND `variables`.`type` IN ('SystemVariable')
SQL
ActiveRecord::Base.connection.execute query
end

def longterm_validator
Expand Down

0 comments on commit 8a35177

Please sign in to comment.