Displaying 20 results from an estimated 6000 matches similar to: "Model Inheritance?"
2006 Mar 08
8
Acts_as_authenticated plugin?
Hi,
I''ve just downloaded the acts_as_authenticated plugin but I can''t find much
in the way of documentation.
First is there anywhere that someone could point me to to get a handle on
this.
Second.. Does the plugin still require the use of generators to use?
Thanx in advance
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2008 Jun 24
10
Question on passing arguments inside a view.
I''m running into an issue undefined local variable or method
`directoryid'' for #<EditorialsController:0x23f1bf8>
I have two Models on a legacy database and only one controller called
editorials with two actions index and display.
I''m trying to pass in a parameter from the results of my search and
getting the above error.
Example:
two tables one is editorial the
2010 Jun 08
2
type conversion with apply or not
Folks, i thought it should be straightforward but after a few hours poking around, I decided it's best to post my question on this list.
I have a data frame consisting of a (large) number of date columns, which are read in from a csv file as character string. I want to convert them to Date type. Following is an example, where the first column is of integer type, while the rest are type
2013 Jan 29
2
Count entries in postgresql grouped by date
Hi!
I have a table with visits with a visited_at: attribute which is a datetime
field. They seem to be stored as UTC. Now I want to count all visits each
day and return something like:
{
2013-01-01: 8,
2013-01-02: 4,
2013-01-07: 9,
...
}
So, I did it like this which kind of works...:
def self.total_grouped_by_day(start_date, end_date)
visits = where(visited_at:
2024 Oct 30
2
Extracting wind direction and wind speed from wind rose plot
Dear all;
I am searching for a way to extract wind direction and speed from a wind
rose plot. I have a graph and I want to make a dataframe of 5 years with
hourly intervals.
> start_date <- as.POSIXct("2019-01-01 00:00:00")
> end_date <- as.POSIXct("2023-12-31 23:00:00")
> time_sequence <- seq(from = start_date, to = end_date, by = "hour")
> df
2006 Jul 02
7
Generic SingleTable inheritance
Hi all,
I would like to discuss a design idea I have in mind with you, in order
to get critical feedback.
ActiveRecord supports single table inheritance(STI) "per se", BUT you
must add all possible instance variables(properties) of all subclasses
to the "base table"(as columns). I would like to circumvent this
restriction.
Say we have a
class AbstractGenericThing <
2007 Jul 08
2
datetime_select, is creating an instance of the Time class
Hello
It seems that datetime_select, is creating an instance of the Time
class. Why would that be?
I found this while building a site where people can create vigils
(prayer vigils, peace vigils, etc). When I added a validation method
that compared start_date to created_at, it generated the error:
ArgumentError (comparison of Time with DateTime failed):
I was able to put a breakpoint in the
2004 Nov 08
2
Matrix Indexing
Hi,
I have the following problem.
In a csv file I have under column A, the date, and column B, the prices.
Thus, for example, the file looks something like this ->
1/31/04 2.5
2/1/04 2.6
...
4/12/04 3.5
Basically, I use the function inputframe = read.csv( )
which reads the csv file into the inputframe.
My question is, how can I make a function that has, as inputs,
2008 Nov 11
1
Every other week recurring event
I have the code for computing a weekly event:
(start_date..end_date).select{|d| d.wday == wday}
but I am wondering if anyone has any ideas for using this to figure
out a recurring event for every other week. Is it possible to somehow
specify every other within the .select method? Any other
implementation ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message
2006 Mar 18
1
Fixtures and single table inheritance
I''m wondering what the accepted method for doing unit tests on STI models is.
I tried to create a fixture for the class but Rails tries to load that
data into the non-existent child table. I could create a fixture named
for the real, parent table, but then it would be very difficult to
test for the individual functionality and integrity of each sub-class.
I saw this page
2013 Feb 26
4
3 models, joining and nested queries
I have 3 models,
class Host
ref: string
address: string,
name: string
primary_key=''ref''
has_many :rooms, :class_name=>"Room", :foreign_key=>''host_ref''
Class Room
ref :string
host_ref: string
capacity: integer
primary_key=''ref''
has_many
2024 Oct 30
1
Extracting wind direction and wind speed from wind rose plot
A wind rose plot omits time information. Your request is simply not possible.
On October 30, 2024 3:48:03 AM PDT, javad bayat <j.bayat194 at gmail.com> wrote:
>Dear all;
>I am searching for a way to extract wind direction and speed from a wind
>rose plot. I have a graph and I want to make a dataframe of 5 years with
>hourly intervals.
>
>> start_date <-
2006 Jul 26
3
Polymorphic Association with Single Table Inheritance?
Hello,
is it possible to setup a model/table schema like this:
Groupable --> Membership <-- Group
^ ^
| |
User UserGroup
I tried the following but failed:
Groupable (table with ''type'' column)
has_many :memberships, :as => :groupable
has_many :groups, :through => :memberships
2006 Jan 17
10
Is STI the only way to do inheritance?
I''m currently coding a system which must store multiple contact methods for
a user (phone, email, postal address etc). I''m planning a fairly
straightforward inheritance hierachy for these, where each different method
inherits from something like a ContactMethod class.
The only mention of ActiveRecord support for inheritance I can find in the
Wiki and the Agile Web Dev book is
2006 Jul 06
5
Single table inheritance
I''m having a class called Person, with subclasses as goalkeeper,
forward, defender.
Now a person can be a forward as well as a defender or a goalkeeper.
I want to use single table inheritance like :
class Goalkeepr < Person
end
And not have multiple boolean columns like in my people table like is
is_goalkpeer, is_forward, is_defender.
How do I go about it ?
Thanks,
Pratik
--
rm
2008 Nov 04
3
Nester Resources, Routes and Class Inheritance
Ok here''s a quicky... but a goody :)
We have models Company, Reference and Applicant... and References and
Applicants just inherit from Company, and are basically companies with
the type field set to reference...
All companies can have a phone number associated with them, and phone
number is a different model...
I''m having trouble using the form_for method with a company that
2006 Jul 13
5
ActiveRecord inheritance
How to create a super class based on ActiveRecord::Base?
For example:
class ParentRecord < ActiveRecord::Base
end
class ChildRecord < ParentRecord
end
Rails always asks for ''parent_records'' table. Which has absolutely no
need to exist at all. It''s intentionally made as a super class to be
inherited.
Thanks.
--
Posted via http://www.ruby-forum.com/.
2008 Jan 16
4
How to test if one range of dates overlaps another?
Hi all,
I have a situation with a recurring billing application where I need
to test if one range of dates "overlaps" another range of dates. Does
anyone know a rails find or mysql select statement that will test for
this? Here are the details:
* Recurringcharge items have a start_date and an end_date that
represent the period of time that the charges should occur.
* Statement items
2006 Feb 09
2
Crazy @55 Inheritance
I have one table, called "people".
Within this table, there are type "users", "managers".... etc. So, basic
STI.
Now, I want a "user" to have one manager, but a "manager" to have many
"users".
Since I don''t want to use HABTM... how do I set this relationship up seeing
that :has_one, :belongs_to and :has_many don''t
2005 Dec 29
9
Single Table Inheritance
Hi all,
Quick question for STI. With the following setup:
class Company < AR::Base; end
class Firm < Company; end
Why does Firm.find(:all) return all Companies, not just those that have
type==''Firm''?
--
Alex