Need Rails 2.3.5 Query Code based on Below Models and Tables

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Need Rails 2.3.5 Query Code based on Below Models and Tables

nyt1972
Hello,

Below are my Models and Tables/Migrations and I want Query Code based on them

Model: FinanceFeeCategory
Table: finance_fee_categories
Fields:  id,name,batch_id

Model: FinanceFeeParticular
Table: finance_fee_particulars
Fields: id,finance_fee_category_id,student_category_id,admission_no,batch_id, due_date

Model: Batch
Table: batches
Fields:  id, name




Relationships:

class FinanceFeeCategory < ActiveRecord::Base
  belongs_to :batch
  belongs_to :student
  #
  has_many   :fee_particulars, :class_name => "FinanceFeeParticular"
  has_many   :fee_discounts
  has_many   :batches,:through=>:category_batches
  has_many   :category_batches
 
 class FinanceFeeParticular < ActiveRecord::Base
  belongs_to :finance_fee_category
  belongs_to :student_category
  belongs_to :receiver,:polymorphic=>true
  belongs_to :batch
  has_many   :fee_discounts
 
 
  class Batch < ActiveRecord::Base

  belongs_to :course

  has_many :students
  has_many :fee_category , :class_name => "FinanceFeeCategory"
 
 
  I am Using Rails 2.3.5 and Ruby 1.8.7
 
  Now I have a Dropdown filled with batches I want to populate another Dropdown with Fee Categories based on the
  Batch selected

And then a 3rd dropdown with Particulars based on the Category selected

and the need a Query to get all the Students admission_no
  based the Due_date if less the Currenct Date for Each the Particular I select from drop down.
 
  Pls someone help me in this.

Thanks in advance.
  

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5781dc46-d3ce-4994-8e05-74104416746e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Need Rails 2.3.5 Query Code based on Below Models and Tables

Colin Law
If you read the Rails Guides you will find much useful information.  However I suggest that first you work right through a good tutorial such as railstutorial.org (which is free to use online) which will show you the basics of Rails.  Then you will be able to answer such questions yourself.

Colin

On 23 April 2018 at 11:58, nyt1972 <[hidden email]> wrote:
Hello,

Below are my Models and Tables/Migrations and I want Query Code based on them

Model: FinanceFeeCategory
Table: finance_fee_categories
Fields:  id,name,batch_id

Model: FinanceFeeParticular
Table: finance_fee_particulars
Fields: id,finance_fee_category_id,student_category_id,admission_no,batch_id, due_date

Model: Batch
Table: batches
Fields:  id, name




Relationships:

class FinanceFeeCategory < ActiveRecord::Base
  belongs_to :batch
  belongs_to :student
  #
  has_many   :fee_particulars, :class_name => "FinanceFeeParticular"
  has_many   :fee_discounts
  has_many   :batches,:through=>:category_batches
  has_many   :category_batches
 
 class FinanceFeeParticular < ActiveRecord::Base
  belongs_to :finance_fee_category
  belongs_to :student_category
  belongs_to :receiver,:polymorphic=>true
  belongs_to :batch
  has_many   :fee_discounts
 
 
  class Batch < ActiveRecord::Base

  belongs_to :course

  has_many :students
  has_many :fee_category , :class_name => "FinanceFeeCategory"
 
 
  I am Using Rails 2.3.5 and Ruby 1.8.7
 
  Now I have a Dropdown filled with batches I want to populate another Dropdown with Fee Categories based on the
  Batch selected

And then a 3rd dropdown with Particulars based on the Category selected

and the need a Query to get all the Students admission_no
  based the Due_date if less the Currenct Date for Each the Particular I select from drop down.
 
  Pls someone help me in this.

Thanks in advance.
  

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5781dc46-d3ce-4994-8e05-74104416746e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtGtP6wbOV4ntfOBnKjdhJp-AVpCzgtxW7DqfZFt_d3Pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.