I'm getting the following when I try to run a migration:
NoMethodError: undefined method `column' for #<Foreigner::ConnectionAdapters::ForeignKeyDefinition:0x007fa020938740>
Here's the migration code:
class CreateAdvertisement < ActiveRecord::Migration
def change
create_table :advertisement do |t|
t.integer :issue_id, null: false
t.string :client_name, null: false
t.decimal :size, null: false
t.decimal :price, null: false
t.decimal :commission_amount, null: false
t.string :first_payment, null: false
t.string :second_payment, null: false
t.timestamps null: false
t.foreign_key :issue
end
end
end
I have Foreigner 1.6.1 installed, Rails 4.2.0. Any ideas?
You, or one of your gems use the 'foreigner' gem, which is deprecated with rails 4.2.0
You should update it or remove this dependency. Maybe someone already did it, for example i use 'mailboxer' gem, and 'github.com/div' already forked the project to create a branch, so i changed my Gemfile :
gem 'mailboxer', :git => 'git://github.com/div/mailboxer.git', :branch => 'rails42-foreigner'
You don't need foreigner with Rails 4.2, as it already has foreign-key support built-in. The syntax is very similar (although not identical) to foreigner.
See: http://edgeguides.rubyonrails.org/4_2_release_notes.html#foreign-key-support
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With