Passing rubocop
This commit is contained in:
parent
6cd1de21dd
commit
cb6e5ce29f
4 changed files with 3 additions and 7 deletions
|
|
@ -11,7 +11,6 @@ class CreateVisits < ActiveRecord::Migration
|
||||||
else
|
else
|
||||||
t.integer :visitor_id
|
t.integer :visitor_id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# the rest are recommended but optional
|
# the rest are recommended but optional
|
||||||
# simply remove the columns you don't want
|
# simply remove the columns you don't want
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ class CreateAhoyEvents < ActiveRecord::Migration
|
||||||
else
|
else
|
||||||
t.integer :visit_id
|
t.integer :visit_id
|
||||||
end
|
end
|
||||||
|
|
||||||
# user
|
# user
|
||||||
t.integer :user_id
|
t.integer :user_id
|
||||||
# add t.string :user_type if polymorphic
|
# add t.string :user_type if polymorphic
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ class SplitTicketPriceInPriceAndCurrency < ActiveRecord::Migration
|
||||||
|
|
||||||
def change
|
def change
|
||||||
adapter_type = connection.adapter_name.downcase.to_sym
|
adapter_type = connection.adapter_name.downcase.to_sym
|
||||||
|
|
||||||
case adapter_type
|
case adapter_type
|
||||||
when :postgresql
|
when :postgresql
|
||||||
add_monetize :tickets, :price
|
add_monetize :tickets, :price
|
||||||
|
|
@ -15,7 +15,6 @@ class SplitTicketPriceInPriceAndCurrency < ActiveRecord::Migration
|
||||||
add_money :tickets, :price
|
add_money :tickets, :price
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
TempTicket.all.each do |ticket|
|
TempTicket.all.each do |ticket|
|
||||||
# Replace currency symbol with ISO Code
|
# Replace currency symbol with ISO Code
|
||||||
if ticket.ticket_price
|
if ticket.ticket_price
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,12 @@
|
||||||
class ChangeVisitIdTypeOfAhoyEventsToInteger < ActiveRecord::Migration[5.0]
|
class ChangeVisitIdTypeOfAhoyEventsToInteger < ActiveRecord::Migration[5.0]
|
||||||
def change
|
def change
|
||||||
adapter_type = connection.adapter_name.downcase.to_sym
|
adapter_type = connection.adapter_name.downcase.to_sym
|
||||||
|
|
||||||
case adapter_type
|
case adapter_type
|
||||||
when :postgresql
|
when :postgresql
|
||||||
change_column :ahoy_events, :visit_id, :integer, limit: nil, using: "('x' || translate(left(visit_id::text, 18), '-', ''))::bit(32)::int"
|
change_column :ahoy_events, :visit_id, :integer, limit: nil, using: "('x' || translate(left(visit_id::text, 18), '-', ''))::bit(32)::int"
|
||||||
else
|
else
|
||||||
change_column :ahoy_events, :visit_id, :integer, limit: nil
|
change_column :ahoy_events, :visit_id, :integer, limit: nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue