Tag Archives: database

Polymorphic Associations in rails

  Refer above figure and tables products,employees and pictures With polymorphic associations, a model can belong to more than one other model, on a single association 1) In Picture model want to mention as follows class Picture < ActiveRecord::Base belongs_to … Continue reading

Posted in rails, ROR, ruby on rails, web development | Tagged , , , | Leave a comment

The has_one :through Association in rails

  Refer above figure and the tables suppliers,accounts,account_histories A has_one :through association sets up a one-to-one connection with another model. 1) In Supplier model want to mention as follows class Supplier < ActiveRecord::Base has_one :account has_one :account_history, :through => :account … Continue reading

Posted in rails, ROR, ruby on rails, web development | Tagged , , , | Leave a comment

has_many :through association in rails

  Refer above figure and the tables physicians, patients and appointments. This association is often used to set up a many-to-many connection with another model. 1) In Physician model want to mention as follows class Physician < ActiveRecord::Base has_many :appointments … Continue reading

Posted in rails, ROR, ruby on rails, web development | Tagged , , , | Leave a comment

Error installing sqlite3- Failed to build gem native extension in debian.

Solution:- install – libsqlite3-dev   http://www.klairvoyant.in  

Posted in rails, ROR, ruby on rails, web development | Tagged , , | Leave a comment