carrierwave – rails 3.1- undefined method: image_will_change

The OP comments that he fixed it, however there’s no answer set so I thought I’d add one for people coming across this in the future, which included myself until I figured it out 🙂 undefined method `x_will_change!’ for # happens if you forget to add a column in your model’s db table. If you … Read more

Testing Rails 3.1 mountable engine with Rspec

I am using RSpec with a Rails engine without issues. I created my plugin using the following switches: -T –full –dummy-path=spec/dummy. -T excludes test/unit –full indicates that the plugin is an engine –dummy-path is simply so that we don’t get a test directory (the default is test/dummy). From there I used the spec_helper from the … Read more

Rails 3.1 – Pushing to Heroku – Errors installing postgres adapter?

Option 1: Add pg to your Gemfile but skip trying to install it locally. $ cat Gemfile … group :production do # gems specifically for Heroku go here gem “pg” end # Skip attempting to install the pg gem $ bundle install –without production Option 2 (Debian/Ubuntu): Add pg to your Gemfile but first install … Read more

skip certain validation method in Model

Update your model to this class Car < ActiveRecord::Base # depending on how you deal with mass-assignment # protection in newer Rails versions, # you might want to uncomment this line # # attr_accessible :skip_method_2 attr_accessor :skip_method_2 validate :method_1, :method_3 validate :method_2, unless: :skip_method_2 private # encapsulation is cool, so we are cool # custom … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)