It is useful in a small number of situations, mostly where you need to
ensure that two different references to the same object actually refer to
the same instance. I've only needed to use it twice, both times were where
we have callbacks updating multiple related objects based on data held in
That's because users are actually different. To fix this you need to pass a
user record into the FactoryGirl's create method.
let(:user) {FactoryGirl.create(:user)}
let(:status) {FactoryGirl.create(:status, user: user)}
Regards,
Anton
понедельник, 12 ноября 2012 г., 14:03:19 UTC+4 пользователь
[SOLVED] the issue was not with cookies .. I had to change the way I
handle the session store w subdomain ... should not using domain = :all
I finally set in initializers/session_store.rb
Rails.application.config.session_store :active_record_store, :key =
'_myapp_session', :domain = {
I initialized it :
Rails.application.config.session_store :active_record_store, :key =
'_yoogroop_session', :domain = {
production: 'yoogroop.com',
development: 'lvh.me'}.fetch(Rails.env.to_param.to_sym, :all)
and I need to get the :domain value in my controller
cookies.delete(:login,
Hello,
Consider this code, it gets a mention and an array of tags.
It finds the mentions and add the tags.
But in my methods I keep using return if foo.nil?
or execute a line of code if a line is not nil.
Is there a better way of doing this kind of thing?
Thks
def add_tags_to_mention
On Tue, Nov 13, 2012 at 6:22 AM, rodrigo coutinho
rodrigo.coutinh...@gmail.com wrote:
Consider this code, it gets a mention and an array of tags.
It finds the mentions and add the tags.
But in my methods I keep using return if foo.nil?
or execute a line of code if a line is not nil.
Is there
Hi all.
I have models:
has_many :bookings
has_many :projects, :through = :bookings
has_many :bookings
has_many :weeks, :through = :bookings
belongs_to :project
belongs_to :week
Now I want to get all coresponding entries from the bookings and weeks
table filtered by a query.
On 13 November 2012 13:34, Werner webagentur.la...@googlemail.com wrote:
Hi all.
I have models:
has_many :bookings
has_many :projects, :through = :bookings
has_many :bookings
has_many :weeks, :through = :bookings
belongs_to :project
belongs_to :week
Now I want to get all
Returning nil is a little bit ambiguous. Did the method finished
correctly or a condition wasn't met?
I always try to return something or throw an exception when needed.
I don't know if there's a best practice for that.
On Tue 13 Nov 2012 10:24:00 AM ART, Jordon Bedwell wrote:
On Tue, Nov
Alright, based on your opinion of returning nil,I changed the method a
little bit. In fact return false is better.
Thank you.
class Mention
def self.build_and_save_tags mention_id, *tags
mention = Mention.find mention_id
return false if mention.blank?
tags.each do |tag_id|
tag = Tag.find tag_id
with the project_id you get already all the corresponding bookings , right ?
@bookings = Booking.find_all_by_project_id(params[:id])
= [#Booking id: 1, week_id: 47, project_id: 2, hour: 4, #Booking id: 2,
week_id: 48, project_id: 2, hour: 7]
and you want the data associated with the week and the
I have set
match '/:locale' = welcome#home, :as = :root
but it doesn't cover the default case, when user enter the domain url wo
locale, http://www.myapp.com
Is there any way to default it to the app default locale I18n.locale ??
thanks for feedback
--
You received this message
Hallo Erwin.
yes I want the data from week with the id 47 and 48 (in this case)
Am Dienstag, 13. November 2012 15:23:02 UTC+1 schrieb Erwin:
with the project_id you get already all the corresponding bookings , right
?
@bookings = Booking.find_all_by_project_id(params[:id])
= [#Booking
Hallo Erwin..
When you work with
before_filter :set_locale
def set_locale
# update sessions if passed
session[:locale] = params[:locale] if params[:locale]
# set locale based on sessions or default
I18n.locale = session[:locale] || I18n.default_locale
end
just create
root :to = 'welcome#index'
is enough
Am Dienstag, 13. November 2012 15:37:06 UTC+1 schrieb Werner:
Hallo Erwin..
When you work with
before_filter :set_locale
def set_locale
# update sessions if passed
session[:locale] = params[:locale] if params[:locale]
# set locale
On 13 November 2012 13:56, Werner webagentur.la...@googlemail.com wrote:
Hi Colin.
Please remember to reply to the list and please don't top post, it
makes it difficult to follow the thread. Insert your reply inline at
appropriate points in the previous message. Thanks.
1. I ask for entries
On 13 November 2012 15:15, Colin Law clan...@googlemail.com wrote:
On 13 November 2012 13:56, Werner webagentur.la...@googlemail.com wrote:
Hi Colin.
Please remember to reply to the list and please don't top post, it
makes it difficult to follow the thread. Insert your reply inline at
I'm not sure how best to do this. I have a project that has Features (these
are video links) that go into a homepage.
It also has Events, which get displayed in a table, can be clicked on, and
a page about that event displays.
I'm working in an admin application for this site, a type of CMS
On 13 November 2012 16:22, RVince rvinc...@hotmail.com wrote:
I'm not sure how best to do this. I have a project that has Features (these
are video links) that go into a homepage.
It also has Events, which get displayed in a table, can be clicked on, and a
page about that event displays.
I'm
Colin, no, events and features have no relationship to each other
(Eventfeatures are like features, but they are a separate object here). So:
Event has_many : evenfeatures
and
Eventfeature belongs_to: event
Thanks! rvince
On Tuesday, November 13, 2012 11:22:30 AM UTC-5, RVince wrote:
I'm
On 13 November 2012 17:02, RVince rvinc...@hotmail.com wrote:
Colin, no, events and features have no relationship to each other
(Eventfeatures are like features, but they are a separate object here). So:
Event has_many : evenfeatures
and
Eventfeature belongs_to: event
So why were you
On Tuesday, November 13, 2012 12:16:15 PM UTC-5, Colin Law wrote:
You know that if you have
an event then its eventfeatures are event.eventfeatures and if you
have an eventfeature then its event is eventfeature.event?
Ah, it's coming back to me now, yes, you've put me on the right
Hello,
I want to use username so I can log in with username.
So I made this migration file :
class AddDeviseToUsers ActiveRecord::Migration
def self.up
change_table(:users) do |t|
## Database authenticatable
t.string :username,:null = false, :default =
you need create_table meathod instead change_table.
Matt's
On Tue, Nov 13, 2012 at 3:08 PM, roelof rwob...@hotmail.com wrote:
Hello,
I want to use username so I can log in with username.
So I made this migration file :
class AddDeviseToUsers ActiveRecord::Migration
def self.up
I know it's been several months since your post, but I hope I can still
pick your brain on the topic:
I'm curious as to why you are trying to use a Rails server for this task
as opposed to a Java-based server since your starting point is Jena?
Have you explored other interfaces to your semantic
On 13 November 2012 17:30, RVince rvinc...@hotmail.com wrote:
On Tuesday, November 13, 2012 12:16:15 PM UTC-5, Colin Law wrote:
You know that if you have
an event then its eventfeatures are event.eventfeatures and if you
have an eventfeature then its event is eventfeature.event?
Ah, it's
On 13 November 2012 18:18, Carlos Mathiasen gunmath...@gmail.com wrote:
you need create_table meathod instead change_table.
And since the users table does not already exist you should uncomment
the t.timestamps line.
Colin
Matt's
On Tue, Nov 13, 2012 at 3:08 PM, roelof
On 13 November 2012 19:05, Chuck H. li...@ruby-forum.com wrote:
I know it's been several months since your post, but I hope I can still
pick your brain on the topic:
I'm curious as to why you are trying to use a Rails server for this task
as opposed to a Java-based server since your starting
I am trying to determine what is going on with the following code:
In AR
def self.all_billables
where( :is_billed = false )
end
returns 2 records.
def self.all_billables
where( is_billed = false )
end
also returns 2 records.
In sqlite3
sqlite select * from tests where ( is_billed =
On 13 November 2012 20:40, byrnejb byrn...@harte-lyne.ca wrote:
I am trying to determine what is going on with the following code:
In AR
def self.all_billables
where( :is_billed = false )
end
returns 2 records.
def self.all_billables
where( is_billed = false )
end
also returns 2
Thanks Colin,
Yeah, I better do that. I'm not a newbie, BUT I haven;t been on an RoR
project since 09 (just all Python and Java in the interim) and the Magic
of things like ActiveRecord I have forgotten about, not to mention much of
the syntax. Thanks for your help here.
rvince
On Tuesday,
Chuck H. wrote in post #1084300:
Is the other option to bypass Jena completely and use RDF.rb directly on
the web layer interface?
I know it's been several months since your post, but I hope I can still
pick your brain on the topic:
I'm curious as to why you are trying to use a Rails server
On Tuesday, November 13, 2012 3:45:30 PM UTC-5, Colin Law wrote:
Look in log/development.log to see what the difference is in the
queries (which should be logged there). Then it will probably make
sense.
This is the difference:
(0.2ms) SELECT COUNT(*) FROM tests WHERE (is_billed =
On 13 November 2012 21:05, byrnejb byrn...@harte-lyne.ca wrote:
On Tuesday, November 13, 2012 3:45:30 PM UTC-5, Colin Law wrote:
Look in log/development.log to see what the difference is in the
queries (which should be logged there). Then it will probably make
sense.
This is the
On Tuesday, November 13, 2012 4:16:17 PM UTC-5, Colin Law wrote:
By using :is_billed = false you are telling rails that you want the
value to be whatever rails uses as the logical value false (which
appears to be f). By specifying yourself that the contents of the
column must be the
Hi Geeks,
I need an urgent help with queue-tip installation. i am
using http://queue-tip.rubyforge.org/install.html guide to install the same
however i am stuck at first step of installation ($ rake gems:install).
i installed all the dependencies mentioned in the document (ruby, rails
etc.)
On 13 November 2012 17:36, mustafa zargar must...@almuqeet.net wrote:
Hi Geeks,
I need an urgent help with queue-tip installation. i am using
http://queue-tip.rubyforge.org/install.html guide to install the same
however i am stuck at first step of installation ($ rake gems:install).
i
Following your link reveals code at github. This code was touched the last
time 4 years ago. It will not run with rails 3 or above.
Am 13.11.2012 22:50 schrieb mustafa zargar must...@almuqeet.net:
Hi Geeks,
I need an urgent help with queue-tip installation. i am using
Hi, RoR newbie here. Fairly new, anyway. :). I have a cancan question I'm
hoping someone can help me with. I have two models - ProposalRequest and
Proposal.Each ProposalRequest can have many Proposals, but a given user can
submit only one Proposal for each ProposalRequest. I can't
I've recently started a challenge to learn Ruby on Rails in 26 days. I'm
on day five, and I've been getting a lot of support. So I decided to
reach out to find a Rails community that would be interested in giving
me some feedback on my progress, and this forum seems like a pretty good
place to
Caros,
Vamos ter start amanhã?
Quem confirma?
[ ]'s,
Fernando Kosh
[:koshtech] = 'http://koshtech.com'
+55 21 9699-3775 / 8695-9776
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send email to
Hi,
This query is a replica of the link
http://railsforum.com/viewtopic.php?id=51231.
As I was unable to get any replies from the rails forum, I am posting
the same here.
I have developed an app using Rails 3. I have a table made to look
like a calendar. I wanted to know if there were any
That has nothing to do with rails. Also I dont believe it would be possible
without Javascript in general.
Am 14.11.2012 07:46 schrieb nikhil rn li...@ruby-forum.com:
Hi,
This query is a replica of the link
http://railsforum.com/viewtopic.php?id=51231.
As I was unable to get any replies
43 matches
Mail list logo