Grails 3.0.0 findOrCreateBy() missing - grails

Unless I've missed something it seems that the findOrCreateBy() dynamic methods are now missing in 3.0. Is this intentional?
Thanks

You must be missing something. It's still there, both in the documentation and in the source code on GitHub.

Related

How to use Nikkou (newbie Ruby question!)

I'm trying to use Nikkou in a Ruby/Rails class but I don't fully understand the very basics. The Nikkou documentation suggests that you just need to add the gem to the Gemfile and you're away... but I can't make any of the Nikkou additions to Nokogiri work for me.
NoMethodError (undefined method `text_includes' for #<Nokogiri::XML::Document:0x00007fe718540a90>):`
There must be some step I'm missing that's so obvious it isn't even mentioned in the documentation. Can anybody enlighten me?
You need to do
require 'nikkou'

Where to find source code of ActionController::Base

I am checking the structure of the initial steps of a tutorial, to build a blog and while going through the code block by block, got to the point in which I want to read the code of ActionController::Base, but I am not able to find it, maybe some help?
Thank you.
Here it is. You won't find much there, though. Base module is quite thin. It consists almost entirely out of list of modules to include.
you can read the Rails Source Code
https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/base.rb
or the API docs
https://apidock.com/rails/ActionController/Base

Where in Rails source is the list of built-in inflections?

Oddly, I searched through what I think is all of the source code for "geese" thinking I would locate it but I didn't. Does anyone know?
rails/activesupport/lib/active_support/inflections.rb
Take a look at ActiveSupport::Inflector.
If you're looking for the rails code that handles inflections, it's at https://github.com/rails/rails/tree/master/activesupport/lib/active_support/inflector
If you're looking for custom pluralization in an application code, it's usually in config/initializers/inflections.rb

good example for grails using atmosphere plugin

I am looking for a good example or tutorial which deals with grails and the atmosphere plugin.
The tutorials i found seems like to miss some information to get my examples working.
thanks
Now i found something i was looking for. Here you can get a working project with atmosphere used in grails: https://github.com/rbramley/GroovyMagJMS
Did you have a look here?
http://jfarcand.wordpress.com/
Also try asking in the mailing list:
http://groups.google.com/group/atmosphere-framework/

Starting out with vote_fu

Trying my luck with the vote_fu rails plugin. The functionality looks like exactly what I need for a project of mine, but I have hit a roadblock. I have followed the github readme to the letter, installing it as a plugin.
I have put acts_as_voteable on my "Event" model and acts_as_voter on my User model.
In the console, when I try:
>> event.votes
or
>> user.votes
it successfully returns an empty array.
but when I try to do the following:
user.vote_for(event)
I get
"NoMethodError: undefined method `user_id' for #<Vote:0x7f5ed4355540>"
Any ideas? I'm probably just missing something obvious, but maybe something is missing from the plugin's readme.
Thanks.
[Update]
I created a blank application and the plugin works fine, so I think that this problem might be being caused by the use of the "desert" plugin, as my User class is split over two files. If I find the answer, I'll post it so that in the off chance someone else runs into this it may be some help.
Cheers.
Ok, I haven't found a definitive reason why this problem occurred, but I do have strong suspicions that it is due to the use of the "desert" plugin, as my User class is split over two files (the project is using the CommunityEngine plugin as a base),
Anyhow, I found a work around (something I should have tried before posting here). Instead of installing vote_fu as a plugin, I installed it as a gem. And now vote_fu seems to be humming along nicely.
So let that be a lesson to you all!
:-P

Resources