(a) Perhaps no one knows the answer.
(b) It's a weekend.(c) You ask so many questions that are often not easy to understand that many do not bother trying any more.
How do i render an xml view like index.xml.erb or index.xml.builder
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/e328ab8b-2084-4f05-bac0-220f7d7fcccb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<%= render partial: :post, collection: @posts, cached: true %>
<%= collection: @posts, cached: true %>
I've been developing with Rails for a few years now, but one part I haven't used is view fragment caching.I'm using it now, and I'm seeing what I think is undesirable behavior, but I need someone with experience to tell me if it's supposed to be this way.I'm caching a collection, and it runs the query to generate the cache key (count, max updated_at) as expected, but then regardless of whether there is a cache hit, it still runs the main query, and if there are includes, it runs those queries, too. If the view fragment is being served from the cache, then those queries are just wasted time. Has it always been like this?I can work around it by using "<% cache @collection.cache_key do %>" instead of "<% cache @collection do %>", but it seems like it shouldn't run the query in the first place.
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/dcf902c2-9fd2-4841-a9db-51e9f6c01223%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Sunday, September 30, 2018 at 1:31:35 AM UTC-4, Colin Law wrote:
On Sun, 30 Sep 2018, 06:19 Ralph Shnelvar, <ral...@dos32.com> wrote:fugee,
(a) Perhaps no one knows the answer.
(b) It's a weekend.(c) You ask so many questions that are often not easy to understand that many do not bother trying any more.Colin--
Ralph
Saturday, September 29, 2018, 10:10:53 PM, you wrote:
Why doesn't anyone answer my question am i blacklisted?
--
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/ .92674ae3-2eb3-40ec-ac37- 0246699a292e%40googlegroups. com
For more options, visit https://groups.google.com/d/optout .
Ralph
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/ .803563546.20180929221928% 40dos32.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/dc57aaa5-90a8-4e63-89b2-6601b6bec6af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
fugee,
(a) Perhaps no one knows the answer.
(b) It's a weekend.
--
Ralph
Saturday, September 29, 2018, 10:10:53 PM, you wrote:
Why doesn't anyone answer my question am i blacklisted?
--
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/92674ae3-2eb3-40ec-ac37-0246699a292e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ralph
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/803563546.20180929221928%40dos32.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%3D0gLtYRaBgN2W-rUdWnw21oLExuC7_V%3DZJbxT63b23cPUJnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
fugee,
(a) Perhaps no one knows the answer.
(b) It's a weekend.
Ralph
Saturday, September 29, 2018, 10:10:53 PM, you wrote:
Why doesn't anyone answer my question am i blacklisted? -- 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/92674ae3-2eb3-40ec-ac37-0246699a292e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. |
Ralph
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/de84600a-6e50-4625-a681-2fb161d47272%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/92674ae3-2eb3-40ec-ac37-0246699a292e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Sunday, September 23, 2018 at 10:44:50 AM UTC-4, Nielson Rolim wrote:
I'd suggest you create your own solution without ancestry.
I had a similar problem. I have an User model and each user must has one or more parents and one or more children. So I created a join table called users_parents with two attributes user_id and parent_id. In my User model I added to has_and_belongs_to_many entries:
has_and_belongs_to_many :parents, class_name: User, join_table: :users_parents, foreign_key: :user_id, association_foreign_key: :parent_id
has_and_belongs_to_many :children, class_name: User, join_table: :users_parents, foreign_key: :parent_id, association_foreign_key: :user_id
That way, I can add an user as parent of several users or an user as child of several users.
my_user.parents will return all my_user parents and my_user.children will return all my_user children
-- Nielson Rolim nielso...@gmail.comOn 23/09/2018 08:06, fugee ohu wrote:
I wanna create and edit people but ancestry only provides for one parent_id so how can i have two on a form--
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/ .b628326b-66ee-4f50-afb6- a238d2a0766f%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/7d11a65d-07f8-49c4-880f-7dffa0326ad9%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/c95441ee-86b6-4874-a786-bb1bd4bdf5af%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/5421611e-cbc9-4bda-9b92-fc5ae8238bdd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
NO h1 or Third Parties- No sponsorship available for this role
No Relo at this time
Direct hire full time with full benefits/401k
The client stack is Ruby on Rails, Postgres, Angular & Heroku; prior experience with Rails in a production environment is required for this role.
Again NO h1 or Third Parties- No sponsorship available for this role
If interested email me resume and a time to chat.
Have a great day!
Sincerely,
Jennifer Simpson-Black
Executive Director
S&B Consulting Group, LLC
Direct: 972 536 3585
jennifer@sbconsultinggroup.net
http://www.sbconsultinggroup.net
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/ba59dce2-0cf9-445b-8100-d81bc4ec1409%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/7b624a1a-be08-4610-926c-de2ad1a75bb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- "rails new sample" (created a new rails 5.2 app called sample)
- "rails generate scaffold user first_name:string last_name:string" (created resource for running system tests)
- rails test test/system/users_test.rb (this command produced the following)
daveomcd@LAPTOP-GDA9LTDQ:~/rails_projects/sample$ rails test test/system/users_test.rb
Running via Spring preloader in process 2613
/home/daveomcd/.rvm/gems/ruby-2.4.2/gems/spring-2.0.2/lib/spring/application.rb:185: warning: Insecure world writable dir /home/daveomcd/.rvm/gems/ruby-2.4.2/bin in PATH, mode 040777
Run options: --seed 35177
# Running:
E
Error:
UsersTest#test_destroying_a_User:
Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.4.0-17134-Microsoft x86_64)
test/system/users_test.rb:38:in `block in <class:UsersTest>'
Error:
UsersTest#test_destroying_a_User:
Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.4.0-17134-Microsoft x86_64)
bin/rails test test/system/users_test.rb:37
E
Error:
UsersTest#test_creating_a_User:
Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.4.0-17134-Microsoft x86_64)
test/system/users_test.rb:14:in `block in <class:UsersTest>'
Error:
UsersTest#test_creating_a_User:
Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.4.0-17134-Microsoft x86_64)
bin/rails test test/system/users_test.rb:13
E
Error:
UsersTest#test_updating_a_User:
Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.4.0-17134-Microsoft x86_64)
test/system/users_test.rb:26:in `block in <class:UsersTest>'
Error:
UsersTest#test_updating_a_User:
Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.4.0-17134-Microsoft x86_64)
bin/rails test test/system/users_test.rb:25
E
Error:
UsersTest#test_visiting_the_index:
Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.4.0-17134-Microsoft x86_64)
test/system/users_test.rb:9:in `block in <class:UsersTest>'
Error:
UsersTest#test_visiting_the_index:
Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.4.0-17134-Microsoft x86_64)
bin/rails test test/system/users_test.rb:8
Finished in 22.996091s, 0.1739 runs/s, 0.0000 assertions/s.
4 runs, 0 assertions, 0 failures, 4 errors, 0 skips
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/47cfba36-d745-42c6-b586-61f6ccea9593%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Friday, September 1, 2017 at 5:09:37 PM UTC-4, Tobias Sandelius wrote:
I can't find any docs about attachment validations. Are there any? If not, will it be added?
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/5d3f3686-c515-40d9-acb1-c60fb8d9e62f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Saturday, September 1, 2018 at 12:38:53 PM UTC-5, SeongHoon Ryu wrote:
I want to cache with custom
cache_key
of Fragment Caching because I don't want to changeupdated_at
.
So, I googled and found monkeypatch(https://gist.
github.com/tispratik/9276110 ). But It just a monkey patch.
Is there a way to set custom
cache_key
?Thanks
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/ad662458-cfc1-4363-9e03-0b27d81c4943%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/cf613f24-c38f-4961-a63a-e52aee5a39cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Sunday, September 23, 2018 at 5:20:41 PM UTC+1, strzibny@gmail.com wrote:
> Hello all,
>
> I cannot seem to find a way how to reference named fixtures in cases where Rails fixtures auto-id magic is not working.
>
> Imagine a model Message with attributes from and to as integers indicating users IDs.
>
> Now the following fixture won't work:
>
> hello_steve:
> to: steve
> from: jana
> text: Hello there!
>
You need to use the association name, not the foreign key, ie (with the associations you have shown):
recipient: steve
Instead of
to: steve.
it also won't work if you have explicitly assigned an id to steve in the user's.yml File
Fred
> (Given steve and jana are defined in users.yml. They work for other fixtures defined with standard Rails conventions.)
>
> The thing is I need to reference them here (or their ID).
>
> Thing I tried was to put in place Rails belongs_to:
>
> # user.rb
> has_many :sent_messages, class_name: 'Message', foreign_key: 'from'
> has_many :received_messages, class_name: 'Message', foreign_key: 'to'
>
> # message.rb
> belongs_to :recipient, class_name: 'User', foreign_key: 'to'
> belongs_to :author, class_name: 'User', foreign_key: 'from'
>
> Unfortunately Rails won't pick it up and all messages fixtures end up with from and to as '0'.
> Note that the association works, just not for fixtures.
>
> Any ideas?
>
> Thank you
> Josef
--
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/adaf5c7c-14fe-4d32-9a23-1fcbf9591663%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I cannot seem to find a way how to reference named fixtures in cases where Rails fixtures auto-id magic is not working.
Imagine a model Message with attributes from and to as integers indicating users IDs.
Now the following fixture won't work:
hello_steve:
to: steve
from: jana
text: Hello there!
(Given steve and jana are defined in users.yml. They work for other fixtures defined with standard Rails conventions.)
The thing is I need to reference them here (or their ID).
Thing I tried was to put in place Rails belongs_to:
# user.rb
has_many :sent_messages, class_name: 'Message', foreign_key: 'from'
has_many :received_messages, class_name: 'Message', foreign_key: 'to'
# message.rb
belongs_to :recipient, class_name: 'User', foreign_key: 'to'
belongs_to :author, class_name: 'User', foreign_key: 'from'
Unfortunately Rails won't pick it up and all messages fixtures end up with from and to as '0'.
Note that the association works, just not for fixtures.
Any ideas?
Thank you
Josef
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/ebf60074-64dc-4e4b-b98e-3769c407d577%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'd suggest you create your own solution without ancestry.
I had a similar problem. I have an User model and each user must has one or more parents and one or more children. So I created a join table called users_parents with two attributes user_id and parent_id. In my User model I added to has_and_belongs_to_many entries:
has_and_belongs_to_many :parents, class_name: User, join_table: :users_parents, foreign_key: :user_id, association_foreign_key: :parent_id
has_and_belongs_to_many :children, class_name: User, join_table: :users_parents, foreign_key: :parent_id, association_foreign_key: :user_id
That way, I can add an user as parent of several users or an user as child of several users.
my_user.parents will return all my_user parents and my_user.children will return all my_user children
-- Nielson Rolim nielson.rolim@gmail.com
I wanna create and edit people but ancestry only provides for one parent_id so how can i have two on a form--
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/b628326b-66ee-4f50-afb6-a238d2a0766f%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/b628326b-66ee-4f50-afb6-a238d2a0766f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> On Sep 21, 2018, at 8:03 AM, Daynthan Kabilan <dayanthan86@gmail.com> wrote:
>
> Hi,
>
> Anyone please give me some idea about how to write test case with API endpoints.
>
> I have used multiple API in my application. Currently i need to write the testcase to the API. So needs to be some request test specs (using rspec, preferrably) for all of the major ruby API endpoints.
>
> Thanks for advance
We use VCR to wrap around the API. https://github.com/vcr/vcr It's pretty straightforward. You put a VCR block around the part of your test that requests the external resource, and then you just make a normal request inside your test. The first time it runs, VCR will write out a "cassette" for that request, which is just a serialized version of the HTTP traffic response. The next time it runs, you will hit the cassette, not the network. Saves a bunch of time when you are done fiddling with the API tests and have moved on to other parts of your app. If you ever worry about your tests getting away from reality, you can just delete the cassettes and run the test again to refresh them with a newer version.
Walter
>
>
>
> --
> 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/CADKeJyQfjN6WoE1GeBdVR%3DTqTGMS5uOxRYzKRF35eTzUAwdQfQ%40mail.gmail.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/10175416-F15A-4AFC-82E2-0E4E85A7605C%40wdstudio.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/CADKeJyQ%2BV7%2B0T%2BDAbveBj_tf2giTb7ueesyas_Ry5MHeUk8K5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
enum status: [ :in_progress, :on_hold, :cancelled, :shipped ]
I need to split :shipped based on before or after one year from the current date.
enum status: [ :in_progress, :on_hold, :cancelled, :shipped, :archive_shipped ]
how to I write out the scope for the condition? Or should it be written as a self.phase method?
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/59f2c76a-1a21-44e4-8428-756754812a13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.