I'm a professional ruby programmer and your comments opened my eyes. If you don't know what's going on, then that does look like really icky code.
First off, parenthesis in ruby are optional. So calling a method can be done without parenthesis. The following two lines are the same:
print()
print
As are these:
print(1, 2, 3)
print 1, 2, 3
Here's some bits that might explain better what stuff does:
:state
If you prefix a word with a colon that creates an object of type Symbol, with value "state", which is a bit like the string "state". The difference is that every mention of :state is a reference to the same object, while if you create a string "state", and a bit further do it again, those are two different objects. We use symbols because it runs faster for conditionals etc: to compare two symbols the interpreter only needs to check the reference, while to compare two strings, every character needs to be checked.
initial: :active
This creates a Hash with one key-value, with key :initial, and value :active, both symbols. This is equivalent to typing :initial => :active which you encounter a bit further up.
do |var1, var2| .... end
This creates a block, which is like a closure. The variable names between pipes are the arguments this block takes. Any code inside the block is only run when the block is called. In Ruby, every function can have a block passed by adding do ... end to it. Inside this function, the block can be called using the keyword yield, e.g. yield(1,2) to call the block with arguments 1 and 2. The find_each method will loop through every value of the Array it is called on, and run the block once for every value.
project.users.present?
The question mark is a valid character for a method name, there's nothing special happening here, present? is just the name of a method. This could easily have been called is_present, or just present.
a ? b : c
The ternary operator, the same in any language. It translates to "if a, return b, else return c".
->(arg1, arg2) { ... }
This creates a lambda, with arguments arg1 and arg2. A lambda is almost the same as a block, so this is almost the same as typing do |arg1, arg2| ... end