Displaying 20 results from an estimated 70000 matches similar to: "Searching for a gem to manage related records"
2013 Mar 05
4
searching model and has_one association
Howdy.
I have these models:
User, field "mundane_name"
user has_one :instructor_profile (may or may not exist)
instructor_profile, field "sca_name"
belongs_to :user
I would like to craft a search on these fields, which is effectively this,
but in one go:
matching_users = User.where("mundane_name ILIKE ?", "%#{target}%")
matching_profiles =
2013 May 13
1
RAILS GET IDS
I don''t know how to solve something about a project I''m doing in Ruby on
Rails.
I want to save the IDS of my 3 models to my table DETAILS between these,
my BD is Mysql.
ASIGNATURAS--MALLAS--NIVELS-------->ASIGNATURA_ID--_MALLAS_ID--_NIVELS_ID
In the view MALLA, i list my asignaturas, mallas and niveles, and in the
controller MALLA i want to save the arrays to my model
2013 May 27
3
Ransack, acts-as-taggable-on and checkboxes in search form
need some help on ransack filtering.
I have model Project, which has many tags through acts_as_taggable gem.
Project.rb:
class Project < ActiveRecord::Base
include PublicActivity::Common
belongs_to :customer
belongs_to :category
has_many :attachments, :as => :attachable
has_many :reports, :dependent => :destroy
has_many :messages, :dependent
2012 Sep 26
2
Bundle Install ERROR: ERROR: Failed to build gem native extension.
Hello,
I''m trying to setup postgreSQL onto rails on linux and when I type
bundle install this is the error that i get. I guess its not finding
the files
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
extension.
/home/taka/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for bzlib.h... no
checking for BZ2_bzWriteOpen() in -lbz2... no
***
2012 Aug 17
5
How to Include Gem in Different Path
Hi,
I just tried Ruby on Rails (with RailsInstaller 2.1.0) and it works fine
on my PC. However, when I put this on the website, I got the following
error message:
Could not find multi_json-1.3.6 in any of the sources
(Bundler::GemNotFound)
The problem is that the website has multi_json 1.0.4. The website
allows me to download my own gems, but after the process, it is located
at
2013 Sep 20
3
having problem to install the gem `mysql`
I am having problem to install the gem `mysql`.
kirti@kirti-Aspire-5733Z:~$ gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/home/kirti/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb
checking for mysql_query()... -lmysqlclient
checking for main() in -lm... yes
checking for mysql_query()...
PG gem behaves strange. It requires live DB connection to only generate a model. How to turn it off?
2013 May 01
3
PG gem behaves strange. It requires live DB connection to only generate a model. How to turn it off?
I used MySQL as a backend before. Now I had to move to PG since Heroku
doesn''t have MySQL and forces everyone to use their Heroku-PG database.
But PG virsion of Rails works diffidently. I cannot generate a model
without PG server running:
>> C:\ruby\Heroku\App>rails generate model Products
>>
>> C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-
2013 Jul 19
12
Rails 4 "belongs_to: record" association doesn't work
Hi,
I discovered a weird behavior when using a "belongs_to: record" association
in Rails 4.
Given two models A and B:
class A < ActiveRecord::Base
belongs_to :record, class_name: ''B'', foreign_key: ''b_id''
end
class B < ActiveRecord::Base
end
When creating A, it inserts a record in B and returns A with id of nil:
irb(main):001:0>
2013 Apr 05
2
How to manage data in MongoDB
I''m working with MongoDB but i feel impatient with it.
I want tool manage MongoDB same as PHPmyadmin(Mysql),Sqlite manager...
I found some tool for this but I don''t know what I shall use
please give me some advice for this!Thanks...
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2012 Oct 13
4
Database design, working but looking for better ways
Rails 3.1.3
Hi. I have designed the database used for my travel plan application.
You should be able to look at the diagram in the link below, hopefully.
https://cacoo.com/diagrams/biDSyxh8yzk2kIeg
("belongs_to" is omitted since it''s obvious)
Basically, the application can list the destinations from a choice of
the departure.
Not mention that the departure_id (integer) and
2012 Aug 08
1
Creating ToDo List App
Hi,
New Rails user here trying to create a basic todolist app in rails 3.2.6
and running into some foreign key issues. Here''s what I did...
I generated scaffolds
list title:string & task description:text listname:string
Next, in order to link the listname for Tasks and the list titles in the
Lists I generated a migration file which looks like this
class AddListIdToTasks <
2013 Mar 30
1
How to use group in nested associations
The below query fails:
Timesheet.joins(:time_entries).select("timesheets.*,
sum(time_entries.worktime) as total").group("timesheets.start_date")
The models have the following relations:
Timesheet < AR
has_many :activities, dependent: :destroy, inverse_of: :timesheet
has_many :time_entries, through: :activities
accepts_nested_attributes_for :activities,
2012 Aug 16
6
undefined method `with_indifferent_access' for "":String
Hi
I''m having a issue with one object when try to update the attributes in
this object previously saved in the database
I have one object comp and one object reg they have this relationship
comp
has_many regs
reg
belongs_to comp
when run use the method valid? like this
current_contribuyente.comps.build(params[:comp]).valid?
it returns: IndexError (string not matched)
And when
2013 Apr 03
1
validates uniqueness scope allow_blank/allow_nil -> validation error
I have this in a model:
class GenreBadge < ActiveRecord::Base
belongs_to :game, counter_cache: :genre_badges_count, touch: true
belongs_to :genre
validates :game_id, uniqueness: {scope: :genre_id}, allow_blank:
true
end
When I get one existing genre badge
genre_badge = game.genre_badges.first
genre_badge.game_id = nil
genre_badge.save!
It creates an validation exception:
2013 Mar 25
1
validates presence of foreign key fails in nested form
I''m using accepts_nested_attributes as follows:
class Timesheet < ActiveRecord::Base
attr_accessible :status, :user_id, :start_date, :end_date,
:activities_attributes
has_many :activities, dependent: :destroy
has_many :time_entries, through: :activities
accepts_nested_attributes_for :activities, allow_destroy: true
end
class Activity < ActiveRecord::Base
attr_accessible
2012 Sep 15
1
Could not find gem 'nileshtrivedi-gupshup (>= 0) ruby' in the gems available on this machine.
I wish to use nileshtrivedi-gupshup gem but i am getting this error.
Can any one know about this?
ERROR
Could not find gem ''nileshtrivedi-gupshup (>= 0) ruby'' in the gems
available on this machine.
Thanks
Fahim Babar Patel
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email
2013 Feb 17
5
Where do Gems Live (e.g. CKEditor)
I''m a Rails newbie and I have added the CKEditor Gem which is working
okay. To configure the gem though, you have to edit the config file,
which is also working when I do that. However, when I push to github and
pull to my other computer, the config file is not changed.
This lead me to the following broader question: when you use a gem,
where does the code go and how can you make sure it
2012 Oct 11
4
what;s the right url in this case
Hello,
I have this models
class Berichten < ActiveRecord::Base
attr_accessible :bericht, :user
belongs_to :user
belongs_to :Category
end
class User < ActiveRecord::Base
attr_accessible :email, :name
has_many :berichten
end
class Category < ActiveRecord::Base
attr_accessible :id :name
has_many :berichten
end
What I wonder is what the right url is when I want to place a
2013 Sep 06
2
Is there anyone using gem milia (multitenancy)?
I''m looking for examples of how to use the gem and especially the process of
sign-up commented at gem github.
Thanks
Ricardo.
--
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
2013 Feb 08
1
Problem with many to many relationship
Hi
I''m trying to create a many to many relationship between two models.
A User can be associated with many Incidents and vice versa.
class User < ActiveRecord::Base
include ActiveModel::ForbiddenAttributesProtection
has_many :incident_participants, foreign_key: "participant_id"
has_many :participated_incidents, through: :incident_participants
end
class Incident