if_statement --> _if migration
parent
21b8db892e
commit
e28b4430bc
|
@ -1 +1 @@
|
||||||
2.3.2
|
2.3.3
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
```
|
```
|
||||||
<%=
|
<%=
|
||||||
JSON.pretty_generate(request.params.except(:controller, :action, :format, :id))
|
JSON.pretty_generate(request.params.except(:controller, :action, :format, :id, :user_id, :device_id))
|
||||||
%>
|
%>
|
||||||
```
|
```
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -15,7 +15,17 @@ module SequenceMigration
|
||||||
.body
|
.body
|
||||||
.select { |x| x["kind"] == "if_statement" }
|
.select { |x| x["kind"] == "if_statement" }
|
||||||
.each do |x|
|
.each do |x|
|
||||||
binding.pry
|
x["kind"] = "_if"
|
||||||
|
x["args"] = {
|
||||||
|
"lhs": x["args"]["lhs"],
|
||||||
|
"rhs": x["args"]["rhs"],
|
||||||
|
"op": x["args"]["op"],
|
||||||
|
"_then": {
|
||||||
|
"kind": "execute",
|
||||||
|
"args": { "sub_sequence_id": x["args"]["sub_sequence_id"] }
|
||||||
|
},
|
||||||
|
"_else": { "kind": "nothing", "args": {} }
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -37,8 +37,12 @@ class Sequence < ActiveRecord::Base
|
||||||
# Helper used for QAing stuff on staging. Grabs a random sequence from the
|
# Helper used for QAing stuff on staging. Grabs a random sequence from the
|
||||||
# database, runs a migration (does not save) and prints to screen.
|
# database, runs a migration (does not save) and prints to screen.
|
||||||
def self.spot_check
|
def self.spot_check
|
||||||
s = Sequence.order("RANDOM()").first
|
s = random
|
||||||
puts "Sequence ##{s.id} ========="
|
puts "Sequence ##{s.id} ========="
|
||||||
puts s.maybe_migrate.body.to_yaml
|
puts s.maybe_migrate.body.to_yaml
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.random
|
||||||
|
Sequence.order("RANDOM()").first
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,5 +33,4 @@ module ToolSlots
|
||||||
ts.update_attributes!(params) && ts
|
ts.update_attributes!(params) && ts
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue