Ruby on Rails Saturday, January 31, 2015

On 31 January 2015 at 18:00, Alex B. <lists@ruby-forum.com> wrote:
> I am having issue grasping how to accomplish interacting between two
> controller.
>
> My design is as follows: I am coding a Microblog. I can make
> posts, which are text, and need to extract hashtags from that content.
> Right now I use a form_for to get the input for the micropost. I have
> put in the models that a micropost has_many Hashtags and that Hashtags
> belongs_to micropost.
>
> My question is where do I put the code to do this? I can't seem to make
> a new hashtag directly from the view in a similar way as my microposts.
> My initial try was to put the extract code in the create method of the
> Post controller. Anything pointing me in the right direction would be
> great.

As I guess you are a beginner to Rails, I suggest you work right
through a good tutorial such as railstutorial.org (which is free to
use online). That will show you the basics of rails and should answer
your question, and a lot more that you will need to ask.

Colin

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuAzP54KTQvFYXwELW%3DosKjBZyUg4gp%2Bpea%3DqkF_MXP8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 31 January 2015 at 18:42, Tiago Rossi <tiago@boltassessoria.com> wrote:
> Thanks for the answer guys, its truth, I have two versions installed, the
> server has latest version of Cpanel/WHM and it has a script developed by
> Cpanel to install ruby 1.8.3 ( /scripts/installruby ) that way ruby will
> appear at the Cpanel from each user and they can manage the apps, if I
> install any other version I need to manage the apps via command line but I
> need latest version then I've installed ruby from scratch downloading the
> latest version from https://www.ruby-lang.org/en/downloads/
> When I type ruby -v it shows 2.2.0 but at rails it shows 2.3.8. Thanks Very
> Much to shows me the free online book! It will gonna be a very good
> reference to me!
> I'll uninstall the rails and all dependencies and try to install the latest
> version and then I'll install rvm.

Install rvm first, then install rails within rvm. No particular need
to remove anything first unless you need the space.

Colin

> Best Regards!
>
> Tiago Rossi
>
> Em sábado, 31 de janeiro de 2015 07:05:51 UTC-2, Colin Law escreveu:
>>
>> On 31 January 2015 at 05:30, Tiago Rossi <ti...@boltassessoria.com> wrote:
>> > Hello, and first of all, Im starting with ruby and Ive installed into my
>> > server, sorry for my newbie question here guys.
>> > After install rails when I type rails -v it shows Rails 2.3.18 but after
>> > I
>> > type gem dependency rails it shows Gem rails-4.2.0 and other
>> > dependencies.
>>
>> I presume by that you mean that it shows the dependencies for several
>> versions of rails. In which case it means you have several versions
>> of rails installed. Your application will use whichever version you
>> specify in Gemfile.
>>
>> rails -v shows you which version is in use.
>> If you need to manage multiple versions I advise using rvm. Others
>> like rbenv I believe.
>>
>> gem list will show you all the versions of gems that are installed.
>>
>> If you have not already done so then, as you are a beginner with
>> rails, I suggest working right through a good tutorial such as
>> railstutorial.org (which is free to use online). That will show you
>> the basics of rails.
>>
>> Colin
>
> --
> 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 rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/621f3e54-4869-462f-a750-0b01053c0c80%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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtMZgNJqzA6NDH-QvJpmevXhTRny2o2uGc8btH_Jq4xjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Sat, Jan 31, 2015 at 10:00 AM, Alex B. <lists@ruby-forum.com> wrote:
> I am having issue grasping how to accomplish interacting between two
> controller.

You shouldn't be thinking about controllers here at all.

> My design is as follows: I am coding a Microblog. I can make
> posts, which are text, and need to extract hashtags from that content.
> Right now I use a form_for to get the input for the micropost. I have
> put in the models that a micropost has_many Hashtags and that Hashtags
> belongs_to micropost.
>
> My question is where do I put the code to do this?

Since the data that has to be processed is in the Micropost, why not
have the hashtag creation method there?

If you invoke that method on a callback like before_save, then you'll
be able to edit the post and have the hashtags updated each time.

Alternatively you could use a "factory" class to build the hashtags
with the Micropost as the input.

HTH!
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yCNXVrmmFqtaSbcXpefMjqQLnC3kHjvyGifALf7z-APPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hello again guys, very strange, but today I've checked the rails version and it showed Rails 4.2.0 so I think its fine for now.
Thanks and Best Regards

Tiago Rossi

Em sábado, 31 de janeiro de 2015 16:42:01 UTC-2, Tiago Rossi escreveu:
Thanks for the answer guys, its truth, I have two versions installed, the server has latest version of Cpanel/WHM and it has a script developed by Cpanel to install ruby 1.8.3 ( /scripts/installruby ) that way ruby will appear at the Cpanel from each user and they can manage the apps, if I install any other version I need to manage the apps via command line but I need latest version then I've installed ruby from scratch downloading the latest version from https://www.ruby-lang.org/en/downloads/ 
When I type ruby -v it shows 2.2.0 but at rails it shows 2.3.8. Thanks Very Much to shows me the free online book! It will gonna be a very good reference to me!
I'll uninstall the rails and all dependencies and try to install the latest version and then I'll install rvm.
Best Regards!

Tiago Rossi

Em sábado, 31 de janeiro de 2015 07:05:51 UTC-2, Colin Law escreveu:
On 31 January 2015 at 05:30, Tiago Rossi <ti...@boltassessoria.com> wrote:
> Hello, and first of all, Im starting with ruby and Ive installed into my
> server, sorry for my newbie question here guys.
> After install rails when I type rails -v it shows Rails 2.3.18 but after I
> type gem dependency rails it shows Gem rails-4.2.0 and other dependencies.

I presume by that you mean that it shows the dependencies for several
versions of rails.  In which case it means you have several versions
of rails installed.  Your application will use whichever version you
specify in Gemfile.

rails -v shows you which version is in use.
If you need to manage multiple versions I advise using rvm.  Others
like rbenv I believe.

gem list will show you all the versions of gems that are installed.

If you have not already done so then, as you are a beginner with
rails, I suggest working right through a good tutorial such as
railstutorial.org (which is free to use online).  That will show you
the basics of rails.

Colin

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6f4df2d9-1d80-4bd2-a6dd-68b57fd2ed52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Thanks for the answer guys, its truth, I have two versions installed, the server has latest version of Cpanel/WHM and it has a script developed by Cpanel to install ruby 1.8.3 ( /scripts/installruby ) that way ruby will appear at the Cpanel from each user and they can manage the apps, if I install any other version I need to manage the apps via command line but I need latest version then I've installed ruby from scratch downloading the latest version from https://www.ruby-lang.org/en/downloads/ 
When I type ruby -v it shows 2.2.0 but at rails it shows 2.3.8. Thanks Very Much to shows me the free online book! It will gonna be a very good reference to me!
I'll uninstall the rails and all dependencies and try to install the latest version and then I'll install rvm.
Best Regards!

Tiago Rossi

Em sábado, 31 de janeiro de 2015 07:05:51 UTC-2, Colin Law escreveu:
On 31 January 2015 at 05:30, Tiago Rossi <ti...@boltassessoria.com> wrote:
> Hello, and first of all, Im starting with ruby and Ive installed into my
> server, sorry for my newbie question here guys.
> After install rails when I type rails -v it shows Rails 2.3.18 but after I
> type gem dependency rails it shows Gem rails-4.2.0 and other dependencies.

I presume by that you mean that it shows the dependencies for several
versions of rails.  In which case it means you have several versions
of rails installed.  Your application will use whichever version you
specify in Gemfile.

rails -v shows you which version is in use.
If you need to manage multiple versions I advise using rvm.  Others
like rbenv I believe.

gem list will show you all the versions of gems that are installed.

If you have not already done so then, as you are a beginner with
rails, I suggest working right through a good tutorial such as
railstutorial.org (which is free to use online).  That will show you
the basics of rails.

Colin

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/621f3e54-4869-462f-a750-0b01053c0c80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I am having issue grasping how to accomplish interacting between two
controller.

My design is as follows: I am coding a Microblog. I can make
posts, which are text, and need to extract hashtags from that content.
Right now I use a form_for to get the input for the micropost. I have
put in the models that a micropost has_many Hashtags and that Hashtags
belongs_to micropost.

My question is where do I put the code to do this? I can't seem to make
a new hashtag directly from the view in a similar way as my microposts.
My initial try was to put the extract code in the create method of the
Post controller. Anything pointing me in the right direction would be
great.

--
Posted via http://www.ruby-forum.com/.

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/740640da6cd6817409ef33a684d9a7b2%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 31 January 2015 at 05:30, Tiago Rossi <tiago@boltassessoria.com> wrote:
> Hello, and first of all, Im starting with ruby and Ive installed into my
> server, sorry for my newbie question here guys.
> After install rails when I type rails -v it shows Rails 2.3.18 but after I
> type gem dependency rails it shows Gem rails-4.2.0 and other dependencies.

I presume by that you mean that it shows the dependencies for several
versions of rails. In which case it means you have several versions
of rails installed. Your application will use whichever version you
specify in Gemfile.

rails -v shows you which version is in use.
If you need to manage multiple versions I advise using rvm. Others
like rbenv I believe.

gem list will show you all the versions of gems that are installed.

If you have not already done so then, as you are a beginner with
rails, I suggest working right through a good tutorial such as
railstutorial.org (which is free to use online). That will show you
the basics of rails.

Colin

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLu%3DXTQFU7uoq%3D570ReFp_CLtA2i8O3v3N5nEOezojAYPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Friday, January 30, 2015

It seems you have installed rails version 2.3, but when you run gem dependency rails, it shows the data for the latest release. 
Run gem install rails -v 4.2.0 to get the 4.2.0 version
Correct me if I am wrong.

On Sat, Jan 31, 2015 at 11:00 AM, Tiago Rossi <tiago@boltassessoria.com> wrote:
Hello, and first of all, Im starting with ruby and Ive installed into my server, sorry for my newbie question here guys.
After install rails when I type rails -v it shows Rails 2.3.18 but after I type gem dependency rails it shows Gem rails-4.2.0 and other dependencies.
Please, what are the real version?
Thanks very much.

Like that:

#rails -v
Rails 2.3.18

# gem dependency rails
Gem rails-4.2.0
...show the dependencies

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bb878be5-99e0-4db1-af8d-d009564562d1%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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAP5dY1XmTp2a0ex4Q-0FxRPvaWB3Xzq84%3D3BrqrxQTtF6FbjeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hello, and first of all, Im starting with ruby and Ive installed into my server, sorry for my newbie question here guys.
After install rails when I type rails -v it shows Rails 2.3.18 but after I type gem dependency rails it shows Gem rails-4.2.0 and other dependencies.
Please, what are the real version?
Thanks very much.

Like that:

#rails -v
Rails 2.3.18

# gem dependency rails
Gem rails-4.2.0
...show the dependencies

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bb878be5-99e0-4db1-af8d-d009564562d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

If I run:
bundle exec rake db:drop db:create db:migrate
I get error that db:migrate needs to be run with RAILS_ENV=test
if I 
bundle exec rake db:drop db:create db:migrate RAILS_ENV=test
I get error regarding duplicate table again

If I delete db from postgres management screen then run
bundle exec rake db:drop db:create db:migrate RAILS_ENV=test
I can again run the test once, but the second time I get the error that migrations are pending and to run db:migrate RAILS_ENV=test

I wonder why the act of running a simple test trigges this migration message

On Friday, January 30, 2015 at 9:41:26 AM UTC-5, Colin Law wrote:
On 30 January 2015 at 14:17, Sean Kelley <kelle...@gmail.com> wrote:
>
> Thanks. Your command line affects development db also which is not ideal.  I looked up db:test:prepare and it appears to be deprecated in 4.2
> http://stackoverflow.com/questions/15169894/what-does-rake-dbtestprepare-actually-do
>
> I decided to try it anyway with RAILS_ENV=test but I get same error of duplicate table 'users' so I tried without the test env set and I get db connection is closed message for test.

I presume your development db is up to date (so running migrate on
that does nothing).
What happens if you recreate the test db and then run migrate on it?
Does the migrate run successfully?

Colin

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2f7150cc-6139-4387-83a7-7ec254d5a309%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 30 January 2015 at 16:43, PandaR1 <fabio.montarsolo@gmail.com> wrote:
> This very simple script was running in 4.1.6
>
> require '.\config\config.rb'
> require '.\models\transazioni.rb'
>
> Transazioni.where(isprocessed: 'N').each do |tr|
> puts tr.id_transazione + ' ' + tr.transdate.to_s + ' ' + tr.idmaximo.to_s +
> ' ' + tr.codsap
> end
>
> exit
>
>
> database.yml:
>
> # DATA SOURCE
> datasource:
> adapter: oracle_enhanced
> url: jdbc:oracle:thin:@x.x.x.x:1521:xxxx
> username: xxx
> password: xxx
>
>
>
> config.rb:
>
> require 'rubygems'
> require 'active_record'
> require 'yaml'
> require 'logger'
> require 'C:/jrails4/jruby/lib/ojdbc6.jar'
>
> @config_db = YAML::load(File.open("config/database.yml"))
> $src_db = @config_db["datasource"]
>
>
> Now with 4.2.0 I got this error:
>
> C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:587
> warning: already initialized constant Reference

My guess would be that something is getting loaded twice. I suggest
taking out all the requires and putting them back till you get the
problem. That may help you to home in on it.

Colin

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuh8Sf%2BhArNXCTqzfbtZT3OppDJ_7QH3QE3YkvG7PHrOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

P.S.

transazioni.rb (model)

class Transazioni < ActiveRecord::Base   
  self.table_name = 'TRANSAZIONI_CONTABILI'
  establish_connection($src_db)
end

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/aabe062e-fadf-4217-a13f-a6f61566470a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

This very simple script was running in 4.1.6

require '.\config\config.rb'
require '.\models\transazioni.rb'

Transazioni.where(isprocessed: 'N').each do |tr|
puts tr.id_transazione + ' ' + tr.transdate.to_s + ' ' + tr.idmaximo.to_s + ' ' + tr.codsap
end

exit


database.yml:

# DATA SOURCE
datasource:  
  adapter: oracle_enhanced  
  url: jdbc:oracle:thin:@x.x.x.x:1521:xxxx
  username: xxx
  password: xxx



config.rb:

require 'rubygems'
require 'active_record'
require 'yaml'
require 'logger'
require 'C:/jrails4/jruby/lib/ojdbc6.jar'

@config_db = YAML::load(File.open("config/database.yml"))
$src_db = @config_db["datasource"]


Now with 4.2.0 I got this error:

C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:587 warning: already initialized constant Reference
C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/values/time_zone.rb:37 warning: already initialized constant MAPPING
C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/values/time_zone.rb:186 warning: already initialized constant UTC_OFFSET_WITH_COLON
C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/values/time_zone.rb:187 warning: already initialized constant UTC_OFFSET_WITHOUT_COLON
C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:40 warning: already initialized constant BLACKLISTED_ARRAY_METHODS
ActiveSupport::Concern::MultipleIncludedBlocks: Cannot define multiple 'included' blocks for a Concern
               included at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/concern.rb:126
  ClassSpecificRelation at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:54
             Delegation at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:51
           ActiveRecord at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:6
                 (root) at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:5
                require at org/jruby/RubyKernel.java:1071
                require at C:/jrails4_update/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:69
                require at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274
        load_dependency at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240
                require at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274
                 (root) at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/base.rb:1
                 (root) at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/base.rb:23
                require at org/jruby/RubyKernel.java:1071
                require at C:/jrails4_update/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:121
                 (root) at transcont.rb:4

Do I have to modify something or it's a bug?

Tnx
Fabio

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d8546e07-aa04-45f2-9858-e6798c4ade12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Friday, January 30, 2015 at 12:54:15 AM UTC+1, JDog wrote:
> I'm doing some wonky stuff  and I am at a point where I need to, in an after_save callback, modify some data and update an hstore column, but not trigger the save callback again. 
>
> What methods are available to me?
>
>

How about update_column(s) http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-update_columns ?

Fred

> Thank you!

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1596c5fd-4cf7-46a9-bab0-3faf8d44109b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 30 January 2015 at 14:40, Colin Law <clanlaw@gmail.com> wrote:
> On 30 January 2015 at 14:17, Sean Kelley <kelleyfarm@gmail.com> wrote:
>>
>> Thanks. Your command line affects development db also which is not ideal. I looked up db:test:prepare and it appears to be deprecated in 4.2
>> http://stackoverflow.com/questions/15169894/what-does-rake-dbtestprepare-actually-do

I think if you read that right through including /all/ the comments
you will find it has been un-deprecated again.

Colin

>>
>> I decided to try it anyway with RAILS_ENV=test but I get same error of duplicate table 'users' so I tried without the test env set and I get db connection is closed message for test.
>
> I presume your development db is up to date (so running migrate on
> that does nothing).
> What happens if you recreate the test db and then run migrate on it?
> Does the migrate run successfully?
>
> Colin

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvK8b9jvXQE_Cfg-cNxmM%3D%2BOAAF-Cyv3WoydEGkXhnnPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 30 January 2015 at 14:17, Sean Kelley <kelleyfarm@gmail.com> wrote:
>
> Thanks. Your command line affects development db also which is not ideal. I looked up db:test:prepare and it appears to be deprecated in 4.2
> http://stackoverflow.com/questions/15169894/what-does-rake-dbtestprepare-actually-do
>
> I decided to try it anyway with RAILS_ENV=test but I get same error of duplicate table 'users' so I tried without the test env set and I get db connection is closed message for test.

I presume your development db is up to date (so running migrate on
that does nothing).
What happens if you recreate the test db and then run migrate on it?
Does the migrate run successfully?

Colin

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLv6EcQTK5NxL7-1_mp-rKkNGeoLbV65cVB5RkW%3D2PMVFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Thanks. Your command line affects development db also which is not ideal.  I looked up db:test:prepare and it appears to be deprecated in 4.2
http://stackoverflow.com/questions/15169894/what-does-rake-dbtestprepare-actually-do

I decided to try it anyway with RAILS_ENV=test but I get same error of duplicate table 'users' so I tried without the test env set and I get db connection is closed message for test. 

On Friday, January 30, 2015 at 6:42:19 AM UTC-5, Antônio Augusto Sousa Britto wrote:
try this: bundle exec rake db:drop db:create db:migrate db:test:prepare



2015-01-29 14:51 GMT-02:00 Sean Kelley <kelle...@gmail.com>:
I updated to rails 4.2 from 4.1 recently.  Not sure if that fact is related to my problem or not.  I have not run any tests since before update.  Now attempting to run a controller test give me the error:
'migrations are pending' with recommendation to run: bin/rake db:migrate RAILS_ENV=test

when I run migrate on test I get error:
PGDuplicateTable relation 'users' already exists

If I run migration on production I do not get error.  If I run the following:
bundle exec rake db:migrate:reset RAILS_ENV=test
I can then run the test once, but trying to re-run gives me the migration pending error again.  

Incidentally, my first project migration in migrations directory creates users table:
class DeviseCreateUsers < ActiveRecord::Migration
  def change
    create_table(:users) do |t| 
       ...

This is my first rails app so I am wondering what is causing this and how to resolve.  Any ideas?

background: I am developing on windows 7 with rspec testing and Postgres database if any of that matters.

--
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 rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c1324137-ecb6-4a92-802f-833ac0d32528%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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a9518543-12e5-4658-9720-b5d2df954cc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi Rails Talk

I have some downtime before I start my new job and I'm currently available for remote contracting

I am an experienced senior Rails developer (~5 years professional experience) with a particular interest in rapid prototyping, screen scraping, testing, and APIs.

If you are looking for a remote contractor then please reach out! I'm also available for longer term ongoing freelance projects.

Thanks

George

http://github.com/georgedrummond
http://www.linkedin.com/in/georgedrummond
http://georgedrummond.com

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/31cb0488-c283-4b14-b3e2-b9b5bb928ceb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

try this: bundle exec rake db:drop db:create db:migrate db:test:prepare



2015-01-29 14:51 GMT-02:00 Sean Kelley <kelleyfarm@gmail.com>:
I updated to rails 4.2 from 4.1 recently.  Not sure if that fact is related to my problem or not.  I have not run any tests since before update.  Now attempting to run a controller test give me the error:
'migrations are pending' with recommendation to run: bin/rake db:migrate RAILS_ENV=test

when I run migrate on test I get error:
PGDuplicateTable relation 'users' already exists

If I run migration on production I do not get error.  If I run the following:
bundle exec rake db:migrate:reset RAILS_ENV=test
I can then run the test once, but trying to re-run gives me the migration pending error again.  

Incidentally, my first project migration in migrations directory creates users table:
class DeviseCreateUsers < ActiveRecord::Migration
  def change
    create_table(:users) do |t| 
       ...

This is my first rails app so I am wondering what is causing this and how to resolve.  Any ideas?

background: I am developing on windows 7 with rspec testing and Postgres database if any of that matters.

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c1324137-ecb6-4a92-802f-833ac0d32528%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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAK6FffLAXmYZoW57Ur1155OnQBTS2eCrsWFMNyktNzKFA89EWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Thursday, January 29, 2015

I'm doing some wonky stuff  and I am at a point where I need to, in an after_save callback, modify some data and update an hstore column, but not trigger the save callback again. 

What methods are available to me?

Thank you!

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d1619a19-c864-4921-814b-6abff4af41d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Posted this to Stack Overflow yesterday and received no replies, so i figured I would try here.

I am working on a Rails app that has lots of data in many different tables related to each other via :has_many through associations. The problem here is that these associations are not static, like your typical Post - User, Assembly - Part, Book - Author associations that never change. Associations in my app will change all the time. The objective is to find the most efficient way to manage associations between existing objects in the database.

As I've recently discovered, Rails does not automatically create associations between existing objects and nested forms are only usable when associations already exist.

For example, I have a form that loads a Contact from contacts table. Same form has a Commandmulti-select populated from commands table. I want to associate multiple commands with this Contact, so i select few commands in my multi-select, which adds them to an array of hashes called notification_commands. Since Rails does not do automatic association, I have to do something like this:

contact = Contact.find_by_id params[:id]  commands = params[:contact][:notification_commands].collect { |c| c[:id] }  contact.commands << Command.find(commands)

This works OK... unless, lets say, I want to associate another command with this contact. In that case existing association records end up getting duplicated and new one added. Ok, I can do unique validations in my model... or I can just use brute force, destroy all associations and re-establish them again.

contact = Contact.find_by_id params[:id]  commands = params[:contact][:notification_commands].collect { |c| c[:id] }  contact.commands.destroy_all  contact.commands << Command.find(commands)

Ok. Thats not really all that elegant...

Model validations sound like a good option here and I will put them in as an extra safety measure, but why make the application do extra work? Duplicate records should be discarded before they even get to the model.

Another possibility (that I know of) is to compare arrays in my controller and see what the difference is between data in the db and what's being posted from the form.

Now, my views are AngularJS, and I am yet to figure out how to make Angular use Rails _destroy method. If that's not possible, I would have to do another array comparison, now in reverse, to see what associations need to be removed. Again, not very elegant.

So, while the brute force method of destroying all associations and re-establishing them all again works and requires the least amount of code, I don't feel that it is good practice.

Any suggestions on what is the more efficient and cleanest way to manage associations between multiple existing objects?

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a19b1902-1bdc-408f-a06c-dd6f41fcbd96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I am creating my first app in which I want to allow multiple users to use their own api keys.  For example, multiple vendors could each use their own Stripe key for their customer checkout.  Right now my app is working for a single user where I have enviroment variables set on dev machine and heroku.  

To develop ability for code based selection of keys, it makes sense to me that keys should be stored in database encrypted.  Is this the prefered way to go?  Are there any good how-tos on the subject around?

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4254370c-c6aa-4a9c-9a3d-e504589a7639%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I updated to rails 4.2 from 4.1 recently.  Not sure if that fact is related to my problem or not.  I have not run any tests since before update.  Now attempting to run a controller test give me the error:
'migrations are pending' with recommendation to run: bin/rake db:migrate RAILS_ENV=test

when I run migrate on test I get error:
PGDuplicateTable relation 'users' already exists

If I run migration on production I do not get error.  If I run the following:
bundle exec rake db:migrate:reset RAILS_ENV=test
I can then run the test once, but trying to re-run gives me the migration pending error again.  

Incidentally, my first project migration in migrations directory creates users table:
class DeviseCreateUsers < ActiveRecord::Migration
  def change
    create_table(:users) do |t| 
       ...

This is my first rails app so I am wondering what is causing this and how to resolve.  Any ideas?

background: I am developing on windows 7 with rspec testing and Postgres database if any of that matters.

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c1324137-ecb6-4a92-802f-833ac0d32528%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 29 January 2015 at 15:52, Toby Donaldson <donaldsontoby@gmail.com> wrote:
> I am following the guide here:
>
> http://guides.rubyonrails.org/getting_started.html

Rather than starting with the guides (which do not always include all
the necessary details) I suggest working through a good tutorial such
as railstutorial.org (which is free to use online). That should get
you going ok.

>
> I am on part 4.1 but when typing into the command line what it says to type
> I get that bin is not recognized as an internal or external command?

If you want an answer you would be better to tell us what operating
system you are running on exactly what you typed. Preferably
copy/paste from the terminal your command and the result, into a reply
here so that we know you have not introduced a typo here.

Colin

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLt7%3DchqXgRdgbAUmQYmBJQv6W767Bv932YFKLh43nha-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 29 January 2015 at 16:11, Brian Sammon
<rubyonrails-list@brisammon.fastmail.fm> wrote:
> On Thu, 29 Jan 2015 15:54:54 +0000
> Colin Law <clanlaw@gmail.com> wrote:
>
>> On 29 January 2015 at 15:46, Brian Sammon
>> <rubyonrails-list@brisammon.fastmail.fm> wrote:
>> > Is there any good documentation of the controller callback order for
>> > rails?
>> >
>> > I'm not sure whether the before_action comes before the around_action,
>> > if it comes after, or maybe "it depends".
>> >
>> > The Action Controller guide doesn't really answer the question.
>>
>> http://guides.rubyonrails.org/active_record_callbacks.html#available-
>> callbacks
>> says that they are listed in the order they will get called.
>
> I'm sorry -- I was asking about Controller _filters_, not model
> _callbacks_.
>
> If only filters were as well documented as callbacks.

No need to be sorry, my error. That's what comes from not reading the question.

Colin

>
> --
> 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 rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/20150129111145.ee8c8ad738eff741605309d9%40brisammon.fastmail.fm.
> 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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLupjt-qgfV%2B8a4TqQQov83xFRJmMzHMwUw5YEXaXPKwmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Thu, 29 Jan 2015 15:54:54 +0000
Colin Law <clanlaw@gmail.com> wrote:

> On 29 January 2015 at 15:46, Brian Sammon
> <rubyonrails-list@brisammon.fastmail.fm> wrote:
> > Is there any good documentation of the controller callback order for
> > rails?
> >
> > I'm not sure whether the before_action comes before the around_action,
> > if it comes after, or maybe "it depends".
> >
> > The Action Controller guide doesn't really answer the question.
>
> http://guides.rubyonrails.org/active_record_callbacks.html#available-
> callbacks
> says that they are listed in the order they will get called.

I'm sorry -- I was asking about Controller _filters_, not model
_callbacks_.

If only filters were as well documented as callbacks.

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/20150129111145.ee8c8ad738eff741605309d9%40brisammon.fastmail.fm.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 29 January 2015 at 15:46, Brian Sammon
<rubyonrails-list@brisammon.fastmail.fm> wrote:
> Is there any good documentation of the controller callback order for
> rails?
>
> I'm not sure whether the before_action comes before the around_action,
> if it comes after, or maybe "it depends".
>
> The Action Controller guide doesn't really answer the question.

http://guides.rubyonrails.org/active_record_callbacks.html#available-callbacks
says that they are listed in the order they will get called.

Colin

>
> --
> 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 rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/20150129104637.96fd7141b23464613fd80528%40brisammon.fastmail.fm.
> 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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLurYX8qrPwS%2B4Hb%3Dwm0Zk2UZYBjqNEbe1HM6koHRvswAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I am following the guide here:

http://guides.rubyonrails.org/getting_started.html

I am on part 4.1 but when typing into the command line what it says to type I get that bin is not recognized as an internal or external command?

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9b23a12b-ddef-41b4-b71d-a83b6a2241ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Is there any good documentation of the controller callback order for
rails?

I'm not sure whether the before_action comes before the around_action,
if it comes after, or maybe "it depends".

The Action Controller guide doesn't really answer the question.

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/20150129104637.96fd7141b23464613fd80528%40brisammon.fastmail.fm.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hello, 

You can try to read the book https://pragprog.com/book/d-kegrap/growing-rails-applications-in-practice. There are described some techniques and practices which can be useful in real application.

-- 
Alexander Vasyutin
mailto: alex.vasyutin@gmail.com
skype: alexander.vasyutin

On Thursday 29 January 2015 at 16:34, Nicolò Benigni wrote:

Hi to all, I am a junior developer who has worked on differents rails
application but never wrote one.

Now, I would like to develop my first "big" rails app. I would love to
know if someone has some links that suggest good patterns, organization
ecc...

--

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5755A3BE340146D2B730569F9CB57878%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi to all, I am a junior developer who has worked on differents rails
application but never wrote one.

Now, I would like to develop my first "big" rails app. I would love to
know if someone has some links that suggest good patterns, organization
ecc...

--
Posted via http://www.ruby-forum.com/.

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d8d30b03cb5060495a834ab619499ef8%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Wednesday, January 28, 2015

I'd like to present a gem developed for simplifying my controllers:

http://blog.philippneugebauer.net/rails/gem/simplecontroller/codeclimate/2015/01/26/simplecontroller-gem-developed.html

Looking forward to get some feedback from you :)

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c4917276-4c3c-48db-87c3-00df0bb261d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Thank. Don´t need to say anything else. Indeed it is not rails fault.

PostgreSQL 9.3.5 on x86_64-unknown-linux-gnu, compiled by gcc
(Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit


Hassan Schroeder wrote in post #1167348:
> On Wed, Jan 28, 2015 at 8:27 AM, Rodrigo Lueneberg
> <lists@ruby-forum.com> wrote:
>> OK, but if they are the same there would be no need for 2 different
>> types under PostgreSQL database. According to the post link provided,
>
> So you prefer to believe a 5-year-old SO post rather than actual
> product documentation?
>
> Up to you. Regardless, while I read it as numeric and decimal being
> the same thing, you can test that theory yourself. Here's one way:
>
> testdb=# create table things ( name varchar(255), price decimal );
> testdb=# \dS things
> Table "public.things"
> Column | Type | Modifiers
> --------+------------------------+-----------
> name | character varying(255) |
> price | numeric |
>
> This is on a PG 9.3.5 installation, BTW; you didn't mention what
> version you're running, so YMMV.
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> http://about.me/hassanschroeder
> twitter: @hassan

--
Posted via http://www.ruby-forum.com/.

--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6505e5293b145072ab495d5405999694%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.