Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry session
Debugger
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger
This was my solution for a polymorphic many-to-many association
class ItemCountry < ActiveRecord::Base
belongs_to :locatable, :polymorphic => true
belongs_to :country
# fields are :locatable_id, :locatable_type, :country_id
end
class Title < ActiveRecord::Base
has_many :countries, :through => :item_countries, :as => :locatable