Archive for the 'Ruby on Rails' Category
Rails 2.3.3 Released
Ruby on Rails| No Comments »A new release of Rails is available - Rails 2.3.3.Among the usual bug fixes, a few new features were added, from the release notes:
touch is a convenient method to update a record’s timestamp and nothing else. This is extracted from apps whose models “touch‚” others when they change, such as a comment updating the parent.replies_changed_at timestamp […]
Driver Error: Svn Merge
Ruby on Rails, Technology| No Comments » The ’svn merge’ command compares two trees, generates a patch, then
applies that patch to a working copy. Yes, you have complete freedom
to compare any two trees, and thereby generate any patch you want. But
that does *not* mean that ’svn merge’ always will do what you want.
It’s *your* responsbility […]
I need an individual file to be migrated in Rails
Ruby on Rails| No Comments »Rails migrations are great, they allow continual evolution of database schema. Sometimes, especially when prototyping, I hate to run migrations down and up and load data, just to make small independent change in database table. In this situations I run only specific migration:
ruby script/runner ‘require “db/migrate/005_create_blogs”; \n
CreateBlogs.migrate(:down)’
ruby script/runner ‘require “db/migrate/005_create_blogs”;\n
CreateBlogs.migrate(:up)’
This is much typing (for […]
Ubuntu + ROR + Mysql + Svn +VPN
Ruby on Rails, Ubuntu| 1 Comment »Every time we install Ruby/Rails/Mysql/Rmagick/Vpn on Ubuntu Gutsy or Hardy we face the same errors again and again. Lets reduce the installation time and have a loop-back-fix-free or smooth installation experience.
After you run the CD or install Ubuntu, make sure of your Network Proxies if any, if so, you need to add the proxy […]
ROR : Important Points to be noted
Ruby on Rails| No Comments »> Difference between Ruby load and require:
Ruby programs may be broken up into multiple files, and the most natural way to partition a program is to place each nontrivial class or module into a separate file. These separate files can then be reassembled […]
Difference between Mocks and Stubs
Ruby on Rails| No Comments »Many developers confuse the ideas behind stubbing and mocking. Stubbing simply replaces a real-world implementation with a simpler implementation. A stub can replace full login system with a simple substitute. A stub’s job is to simulate the real world. Mocks are not stubs. A mock object, instead, is like a gauge that measures the […]
Single Table Inheritance
General, Ruby on Rails| No Comments » Active Record allows inheritance by storing the name of the class in a column that by default is named “type” (can be changed by overwriting Base.inheritance_column). This means that an inheritance looking like this:
class Company < ActiveRecord::Base; end
class Firm < Company; end
class Client < Company; end
class […]
